From 886bf6bc103e61ee28463c930d962a53cc415df4 Mon Sep 17 00:00:00 2001 From: Arisotura Date: Wed, 12 Jun 2019 12:49:52 +0200 Subject: [PATCH] prevent loading savestates that are too recent --- src/Savestate.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Savestate.cpp b/src/Savestate.cpp index 97fce93e..fff2ec77 100644 --- a/src/Savestate.cpp +++ b/src/Savestate.cpp @@ -110,7 +110,12 @@ Savestate::Savestate(const char* filename, bool save) } fread(&VersionMinor, 2, 1, file); - // TODO: handle it??? + if (VersionMinor > SAVESTATE_MINOR) + { + printf("savestate: state from the future, %d > %d\n", VersionMinor, SAVESTATE_MINOR); + Error = true; + return; + } buf = 0; fread(&buf, 4, 1, file);