mirror of https://github.com/mgba-emu/mgba.git
GB: Fix crash when accessing SRAM if no save loaded and cartridge has no SRAM
This commit is contained in:
parent
0d178a4c3f
commit
5c42c5dcb7
1
CHANGES
1
CHANGES
|
@ -9,6 +9,7 @@ Bugfixes:
|
|||
- 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)
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ void GBResizeSram(struct GB* gb, size_t size) {
|
|||
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) {
|
||||
|
|
Loading…
Reference in New Issue