GB Serialize: Fix loading states with negative pixel x (fixes #1293)

This commit is contained in:
Vicki Pfau 2019-02-12 09:20:37 -08:00
parent cab3a2272d
commit 0df180c0d0
2 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@ Bugfixes:
- Qt: Fix tile and sprite views not always displaying at first
- GBA Memory: Fix a few AGBPrint crashes
- GBA Memory: Fix OOB ROM reads showing up as AGBPrint memory
- GB Serialize: Fix loading states with negative pixel x (fixes mgba.io/i/1293)
Misc:
- GBA Savedata: EEPROM performance fixes
- GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash

View File

@ -113,7 +113,7 @@ bool GBDeserialize(struct GB* gb, const struct GBSerializedState* state) {
error = true;
}
LOAD_16LE(check16, 0, &state->video.x);
if (check16 < 0 || check16 > GB_VIDEO_HORIZONTAL_PIXELS) {
if (check16 < -7 || check16 > GB_VIDEO_HORIZONTAL_PIXELS) {
mLOG(GB_STATE, WARN, "Savestate is corrupted: video x is out of range");
error = true;
}