mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 14:42:13 +00:00
Fixed a crash related to texture-names
Added warning in case of a VIS-decompression overrun git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5358 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
98303e606e
commit
486b1aa722
2 changed files with 7 additions and 1 deletions
|
@ -1933,6 +1933,12 @@ static qbyte *Q1BSP_DecompressVis (qbyte *in, model_t *model, qbyte *decompresse
|
|||
|
||||
c = in[1];
|
||||
in += 2;
|
||||
|
||||
if ((out - decompressed) + c > row) {
|
||||
c = row - (out - decompressed);
|
||||
Con_DPrintf ("warning: Vis decompression overrun\n");
|
||||
}
|
||||
|
||||
while (c)
|
||||
{
|
||||
*out++ = 0;
|
||||
|
|
|
@ -3453,7 +3453,7 @@ TRACE(("dbg: Mod_LoadTextures: inittexturedescs\n"));
|
|||
tx = ZG_Malloc(&loadmodel->memgroup, sizeof(texture_t));
|
||||
loadmodel->textures[i] = tx;
|
||||
|
||||
memcpy (tx->name, mt->name, sizeof(tx->name));
|
||||
Q_strncpyz(tx->name, mt->name, min(sizeof(mt->name)+1, sizeof(tx->name)));
|
||||
tx->width = mt->width;
|
||||
tx->height = mt->height;
|
||||
|
||||
|
|
Loading…
Reference in a new issue