all repos — mgba @ d9764e8cea482fead7e1a3376d1007c884ee252b

mGBA Game Boy Advance Emulator

GB, GBA: Prevent loading null ROMs
Jeffrey Pfau jeffrey@endrift.com
Fri, 21 Oct 2016 19:09:16 -0700
commit

d9764e8cea482fead7e1a3376d1007c884ee252b

parent

a30599e2396c4920d4b068caa682c6ba4c6e8830

3 files changed, 7 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -24,6 +24,7 @@ - GBA Video: Allow multiple handles into the same tile cache

- VFS: Call msync when syncing mapped data - GBA Video, GB Video: Colors are now fully scaled - PSP2: Improved controller rumble + - GB, GBA: Prevent loading null ROMs 0.5.1: (2016-10-05) Bugfixes:
M src/gb/gb.csrc/gb/gb.c

@@ -81,6 +81,9 @@ gb->stream = NULL;

} bool GBLoadROM(struct GB* gb, struct VFile* vf) { + if (!vf) { + return false; + } GBUnloadROM(gb); gb->romVf = vf; gb->pristineRomSize = vf->size(vf);
M src/gba/gba.csrc/gba/gba.c

@@ -490,6 +490,9 @@ return true;

} bool GBALoadROM(struct GBA* gba, struct VFile* vf) { + if (!vf) { + return false; + } GBAUnloadROM(gba); gba->romVf = vf; gba->pristineRomSize = vf->size(vf);