all repos — mgba @ 422c3a25b887ef357e992d725a7e9d06fbfd5713

mGBA Game Boy Advance Emulator

GBA Hardware: Fix crash if a savestate lies about game hardware
Vicki Pfau vi@endrift.com
Mon, 24 Apr 2017 13:34:57 -0700
commit

422c3a25b887ef357e992d725a7e9d06fbfd5713

parent

93122df1f42a46c9475f871f67a66ada85eed0db

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

jump to
M CHANGESCHANGES

@@ -46,6 +46,7 @@ - GBA Video: Don't update background scanline params in mode 0 (fixes mgba.io/i/377)

- Qt: Ensure CLI backend is attached when submitting commands (fixes mgba.io/i/662) - Core: Fix crash with rewind if savestates shrink - Test: Fix crash when loading invalid file + - GBA Hardware: Fix crash if a savestate lies about game hardware Misc: - SDL: Remove scancode key input - GBA Video: Clean up unused timers
M src/gba/gba.csrc/gba/gba.c

@@ -76,6 +76,8 @@

gba->sio.p = gba; GBASIOInit(&gba->sio); + GBAHardwareInit(&gba->memory.hw, NULL); + gba->springIRQ = 0; gba->keySource = 0; gba->rotationSource = 0;
M src/gba/hardware.csrc/gba/hardware.c

@@ -77,6 +77,9 @@ }

} void GBAHardwareGPIOWrite(struct GBACartridgeHardware* hw, uint32_t address, uint16_t value) { + if (!hw->gpioBase) { + return; + } switch (address) { case GPIO_REG_DATA: hw->pinState &= ~hw->direction;