Merge pull request #12384 from AdmiralCurtiss/font-load-offset

HW/CEXIIPL: Fix loading files at nonzero offset in LoadFileToIPL().
This commit is contained in:
Mai 2023-12-10 20:53:22 -05:00 committed by GitHub
commit 6e0bc2a4db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;