HW/CEXIIPL: Check for errors when reading font.

This commit is contained in:
Admiral H. Curtiss 2023-12-09 15:45:29 +01:00
parent 57e166dbef
commit 8194b53166
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
1 changed files with 5 additions and 2 deletions

View File

@ -240,8 +240,11 @@ void CEXIIPL::LoadFontFile(const std::string& filename, u32 offset)
INFO_LOG_FMT(BOOT, "Found IPL dump, loading {} font from {}",
(offset == 0x1aff00) ? "Shift JIS" : "Windows-1252", ipl_rom_path);
stream.Seek(offset, File::SeekOrigin::Begin);
stream.ReadBytes(&m_rom[offset], fontsize);
if (!stream.Seek(offset, File::SeekOrigin::Begin) || !stream.ReadBytes(&m_rom[offset], fontsize))
{
WARN_LOG_FMT(BOOT, "Failed to read font from IPL dump.");
return;
}
m_fonts_loaded = true;
}