GB Serialize: Prevent loading savestates that aren't about to load an instruction
Jeffrey Pfau jeffrey@endrift.com
Mon, 12 Sep 2016 12:38:16 -0700
1 files changed,
4 insertions(+),
0 deletions(-)
jump to
M
src/gb/serialize.c
→
src/gb/serialize.c
@@ -112,6 +112,10 @@ if (check < 0) {
mLOG(GB_STATE, WARN, "Savestate is corrupted: CPU cycles are negative"); error = true; } + if (state->cpu.executionState != LR35902_CORE_FETCH) { + mLOG(GB_STATE, WARN, "Savestate is corrupted: Execution state is not FETCH"); + error = true; + } if (check >= (int32_t) DMG_LR35902_FREQUENCY) { mLOG(GB_STATE, WARN, "Savestate is corrupted: CPU cycles are too high"); error = true;