all repos — mgba @ 6055c4e8dbdf408f7a1a6dc367e5e6e2b9846cac

mGBA Game Boy Advance Emulator

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

6055c4e8dbdf408f7a1a6dc367e5e6e2b9846cac

parent

8821024705c6500ea998431656b3c604b3066898

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

jump to
M CHANGESCHANGES

@@ -15,6 +15,7 @@ Other fixes:

- Core: Ensure ELF regions can be written before trying - 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 - Debugger: Don't skip undefined instructions when debugger attached - Qt: Force OpenGL paint engine creation thread (fixes mgba.io/i/1642) Misc:
M src/gba/gba.csrc/gba/gba.c

@@ -441,6 +441,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");