all repos — mgba @ 5c90abd294cb969722808b9513e3a7ce58db1da7

mGBA Game Boy Advance Emulator

GB, GBA: Fix crashes when attempting to identify null VFiles
Vicki Pfau vi@endrift.com
Sat, 29 Jul 2017 17:32:36 -0700
commit

5c90abd294cb969722808b9513e3a7ce58db1da7

parent

e1bc79b83796d67d7817fe0883e2b0182dcfb2bb

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

jump to
M CHANGESCHANGES

@@ -17,6 +17,7 @@ - GB Video: Fix 16-bit screenshots (fixes mgba.io/i/826)

- GB Core: Fix palette loading when loading a foreign config - Qt: Fix LOG argument order - GB Memory: Prevent accessing empty SRAM (fixes mgba.io/i/831) + - GB, GBA: Fix crashes when attempting to identify null VFiles Misc: - GBA Timer: Use global cycles for timers - GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)
M src/gb/gb.csrc/gb/gb.c

@@ -658,6 +658,9 @@ --cpu->pc;

} bool GBIsROM(struct VFile* vf) { + if (!vf) { + return false; + } vf->seek(vf, 0x104, SEEK_SET); uint8_t header[4];
M src/gba/gba.csrc/gba/gba.c

@@ -527,6 +527,9 @@ ELFClose(elf);

return isGBA; } #endif + if (!vf) { + return false; + } if (vf->seek(vf, GBA_ROM_MAGIC_OFFSET, SEEK_SET) < 0) { return false; }