Permalink
Browse files

GB Serialize: Check for X when loading state

  • Loading branch information...
1 parent 65de1ca commit c292f7ea93a0d653b56891bf1adb318ab9ac3063 @endrift endrift committed Sep 13, 2016
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/gb/serialize.c
View
@@ -127,6 +127,11 @@ bool GBDeserialize(struct GB* gb, const struct GBSerializedState* state) {
mLOG(GB_STATE, WARN, "Savestate is corrupted: video eventDiff is negative");
error = true;
}
+ LOAD_16LE(check16, 0, &state->video.x);
+ if (check16 < 0 || check16 > GB_VIDEO_HORIZONTAL_PIXELS) {
+ mLOG(GB_STATE, WARN, "Savestate is corrupted: video x is out of range");
+ error = true;
+ }
LOAD_16LE(check16, 0, &state->video.ly);
if (check16 < 0 || check16 > GB_VIDEO_VERTICAL_TOTAL_PIXELS) {
mLOG(GB_STATE, WARN, "Savestate is corrupted: video y is out of range");

0 comments on commit c292f7e

Please sign in to comment.