HW/CEXIIPL: Fix loading files at nonzero offset in LoadFileToIPL().

This commit is contained in:
Admiral H. Curtiss 2023-12-11 02:19:25 +01:00
parent c2b642d0b7
commit 694b3b4ea1
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
1 changed files with 1 additions and 4 deletions

View File

@ -168,10 +168,7 @@ bool CEXIIPL::LoadFileToIPL(const std::string& filename, u32 offset)
return false;
const u64 filesize = stream.GetSize();
if (offset >= filesize)
return false;
if (!stream.ReadBytes(&m_rom[offset], std::min<u64>(filesize, ROM_SIZE) - offset))
if (!stream.ReadBytes(&m_rom[offset], std::min<u64>(filesize, ROM_SIZE - offset)))
return false;
m_fonts_loaded = true;