More bounds checking.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2950 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Mark Olsen 2008-05-01 12:24:20 +00:00
parent 9bda9e9fc1
commit 74c6f76f50

View file

@ -953,10 +953,13 @@ void FindNextChunk(char *name)
data_p = NULL;
return;
}
dataleft-= iff_chunk_len;
// if (iff_chunk_len > 1024*1024)
// Sys_Error ("FindNextChunk: %i length is past the 1 meg sanity limit", iff_chunk_len);
data_p -= 8;
last_chunk = data_p + 8 + ( (iff_chunk_len + 1) & ~1 );
last_chunk = data_p + 8 + iff_chunk_len;
if ((iff_chunk_len&1) && dataleft)
last_chunk++;
if (!Q_strncmp(data_p, name, 4))
return;
}