FileSystem: More stringent RGSSAD header checks

This commit is contained in:
Jonas Kulla 2014-01-16 01:06:59 +01:00
parent 9b92a7bc14
commit 91efcfa06d
1 changed files with 6 additions and 2 deletions

View File

@ -297,8 +297,12 @@ RGSS_openArchive(PHYSFS_Io *io, const char *, int forWrite)
/* Check header */ /* Check header */
uint32_t header1, header2; uint32_t header1, header2;
readUint32(io, header1);
readUint32(io, header2); if (!readUint32(io, header1))
return 0;
if (!readUint32(io, header2))
return 0;
if (header1 != RGSS_HEADER_1 || header2 != RGSS_HEADER_2) if (header1 != RGSS_HEADER_1 || header2 != RGSS_HEADER_2)
return 0; return 0;