all repos — mgba @ 3a8ff86d6b5a940630f3cd5d041ab3d13413214f

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

3a8ff86d6b5a940630f3cd5d041ab3d13413214f

parent

f00b7fcf55167fdf243da731b4fe30ab0b56ffc8

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

jump to
M CHANGESCHANGES

@@ -15,6 +15,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 Savedata: EEPROM performance fixes - GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash
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) {