PK3: Proper ignorance for file comments/extra data

This commit is contained in:
fickleheart 2020-02-07 00:01:20 -06:00
parent 7805828c4a
commit 57a4545fdf
1 changed files with 10 additions and 1 deletions

View File

@ -580,7 +580,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
return NULL;
}
lump_p->position = zentry->offset + zentry->namelen + zentry->xtralen + sizeof(zlentry_t);
lump_p->position = zentry->offset + zentry->namelen + sizeof(zlentry_t);
lump_p->disksize = zentry->compsize;
lump_p->size = zentry->size;
@ -629,6 +629,15 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
lump_p->compression = CM_UNSUPPORTED;
break;
}
// skip and ignore comments/extra fields
if (fseek(handle, zentry->xtralen + zentry->commlen, SEEK_CUR) != 0)
{
CONS_Alert(CONS_ERROR, "Central directory %d is corrupt (%02x%02x%02x%02x)\n", i, zentry->signature[0], zentry->signature[1], zentry->signature[2], zentry->signature[3]);
Z_Free(lumpinfo);
free(zentries);
return NULL;
}
}
free(zentries);