diff --git a/src/core/bios.cpp b/src/core/bios.cpp index 2799e337b..26b4de2bc 100644 --- a/src/core/bios.cpp +++ b/src/core/bios.cpp @@ -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;