diff --git a/CHANGES b/CHANGES index 17769d465..0397d71f7 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ Emulation fixes: 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 diff --git a/src/gba/gba.c b/src/gba/gba.c index 769e85ba0..c399ac57c 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -445,6 +445,10 @@ void GBAYankROM(struct GBA* gba) { 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");