Fix a zip-related crash.

This commit is contained in:
Shpoike 2023-06-29 16:37:00 +01:00
parent a7220b86a7
commit bc5967f62c

View file

@ -2056,7 +2056,13 @@ static int COM_FindFile (const char *filename, int *handle, FILE **file,
{
fseek (f, pak->files[i].filepos, SEEK_SET);
f = FSZIP_Deflate(f, pak->files[i].deflatedsize, pak->files[i].filelen);
*handle = Sys_FileOpenStdio(f);
if (f)
*handle = Sys_FileOpenStdio(f);
else
{ //error!
com_filesize = -1;
*handle = -1;
}
}
else
{ //error!