aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraliaspider2014-10-31 00:56:05 +0100
committeraliaspider2014-10-31 00:56:05 +0100
commitfe1e946c5aea3c52d15ce237168abab823e4a8ca (patch)
tree9cd55684eda20d8875efe13c0c7fdd2923feebf3
parent15f51d4158d24e17ce6c4ee923525d496ffdc97e (diff)
downloadsnesemu-fe1e946c5aea3c52d15ce237168abab823e4a8ca.tar.gz
snesemu-fe1e946c5aea3c52d15ce237168abab823e4a8ca.tar.bz2
snesemu-fe1e946c5aea3c52d15ce237168abab823e4a8ca.zip
prevent loading incompatible savestates ( does only check for size ).
-rw-r--r--libretro.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libretro.c b/libretro.c
index ddd8f46..a4de925 100644
--- a/libretro.c
+++ b/libretro.c
@@ -606,8 +606,12 @@ bool retro_serialize(void* data, size_t size)
return true;
}
bool retro_unserialize(const void* data, size_t size)
-{
+{
const uint8_t* buffer = data;
+
+ if (size != retro_serialize_size())
+ return false;
+
S9xReset();
uint8* IAPU_RAM_current = IAPU.RAM;