all repos — mgba @ 45e0eb7013fc8fbc6a819c7d565fc087fb311a7a

mGBA Game Boy Advance Emulator

GBA: Reject incorrectly sized BIOSes
Vicki Pfau vi@endrift.com
Thu, 20 Feb 2020 18:09:45 -0800
commit

45e0eb7013fc8fbc6a819c7d565fc087fb311a7a

parent

94ac31182989b5589dd9fc2a9b85ed49b210a57d

2 files changed, 5 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -6,6 +6,7 @@ - GBA Timers: Fix deserializing count-up timers

Other fixes: - Core: Fix ELF loading regression (fixes mgba.io/i/1669) - Core: Fix crash modifying hash table entry (fixes mgba.io/i/1673) + - GBA: Reject incorrectly sized BIOSes - Qt: Fix OpenGL 2.1 support (fixes mgba.io/i/1678) Misc: - Qt: Disable Replace ROM option when no game loaded
M src/gba/gba.csrc/gba/gba.c

@@ -445,6 +445,10 @@ }

void GBALoadBIOS(struct GBA* gba, struct VFile* vf) { gba->biosVf = vf; + if (vf->size(vf) != SIZE_BIOS) { + mLOG(GBA, WARN, "Incorrect BIOS size"); + return; + } uint32_t* bios = vf->map(vf, SIZE_BIOS, MAP_READ); if (!bios) { mLOG(GBA, WARN, "Couldn't map BIOS");