all repos — mgba @ 84dc182a5d5e3bb7113dda93893bbb65faf68f04

mGBA Game Boy Advance Emulator

Core: Fix crash with rewind if savestates shrink
Vicki Pfau vi@endrift.com
Fri, 21 Apr 2017 16:22:48 -0700
commit

84dc182a5d5e3bb7113dda93893bbb65faf68f04

parent

01832ec513b83ba554f47f45997d2a8b24606c74

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

jump to
M CHANGESCHANGES

@@ -42,6 +42,7 @@ - GBA BIOS: Fix ArcTan sign in HLE BIOS

- GBA BIOS: Fix ArcTan2 sign in HLE BIOS (fixes mgba.io/i/689) - 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 Misc: - SDL: Remove scancode key input - GBA Video: Clean up unused timers
M src/core/rewind.csrc/core/rewind.c

@@ -50,6 +50,8 @@ size_t size = context->currentState->size(context->currentState);

if (size2 > size) { context->currentState->truncate(context->currentState, size2); size = size2; + } else if (size > size2) { + nextState->truncate(nextState, size); } void* current = context->currentState->map(context->currentState, size, MAP_READ); void* next = nextState->map(nextState, size, MAP_READ);