all repos — mgba @ 5c42c5dcb7e9ae6f669768d480f5217955ad1726

mGBA Game Boy Advance Emulator

GB: Fix crash when accessing SRAM if no save loaded and cartridge has no SRAM
Vicki Pfau vi@endrift.com
Wed, 20 Feb 2019 19:44:11 -0800
commit

5c42c5dcb7e9ae6f669768d480f5217955ad1726

parent

0d178a4c3f1a902dcfb460b4b55bbba207cbf428

2 files changed, 2 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -9,6 +9,7 @@ - Qt: Fix audio context holding onto closed game controller

- Switch: Fix gyroscope orientation (fixes mgba.io/i/1300) - GBA SIO: Prevent writing read-only multiplayer bits - Qt: Fix color picking in sprite view (fixes mgba.io/i/1307) + - GB: Fix crash when accessing SRAM if no save loaded and cartridge has no SRAM Misc: - GBA Video: Improve sprite cycle counting (fixes mgba.io/i/1274)
M src/gb/gb.csrc/gb/gb.c

@@ -202,7 +202,7 @@ }

if (gb->memory.sram == (void*) -1) { gb->memory.sram = NULL; } - } else { + } else if (size) { uint8_t* newSram = anonymousMemoryMap(size); if (gb->memory.sram) { if (size > gb->sramSize) {