Fixup IsValidPSExeHeader

This commit is contained in:
Silent 2021-10-28 19:16:55 +02:00
parent 48ddebd82e
commit bcbe93a462
No known key found for this signature in database
GPG key ID: AE53149BB0C45AF1

View file

@ -246,7 +246,7 @@ bool IsValidPSExeHeader(const PSEXEHeader& header, u32 file_size)
if (std::memcmp(header.id, expected_id, sizeof(expected_id)) != 0)
return false;
if (header.file_size > (sizeof(PSEXEHeader) + file_size))
if ((header.file_size + sizeof(PSEXEHeader)) > file_size)
return false;
return true;