mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-20 00:11:19 +00:00
PK3: Proper ignorance for file comments/extra data
This commit is contained in:
parent
7805828c4a
commit
57a4545fdf
1 changed files with 10 additions and 1 deletions
11
src/w_wad.c
11
src/w_wad.c
|
@ -580,7 +580,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
|
||||||
return NULL;
|
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->disksize = zentry->compsize;
|
||||||
lump_p->size = zentry->size;
|
lump_p->size = zentry->size;
|
||||||
|
|
||||||
|
@ -629,6 +629,15 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
|
||||||
lump_p->compression = CM_UNSUPPORTED;
|
lump_p->compression = CM_UNSUPPORTED;
|
||||||
break;
|
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);
|
free(zentries);
|
||||||
|
|
Loading…
Reference in a new issue