GB Deserialize: Fix DMA check

This commit is contained in:
Jeffrey Pfau 2016-09-12 20:02:58 -07:00
parent ff788a017c
commit 65de1caa0c
1 changed files with 1 additions and 1 deletions

View File

@ -133,7 +133,7 @@ bool GBDeserialize(struct GB* gb, const struct GBSerializedState* state) {
error = true;
}
LOAD_16LE(ucheck16, 0, &state->memory.dmaDest);
if (ucheck16 >= GB_SIZE_OAM) {
if (ucheck16 + state->memory.dmaRemaining > GB_SIZE_OAM) {
mLOG(GB_STATE, WARN, "Savestate is corrupted: DMA destination is out of range");
error = true;
}