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
2 files changed,
2 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -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.c
→
src/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) {