GB, GBA Video: Fix integer overflow

This commit is contained in:
Vicki Pfau 2017-04-18 04:02:44 -07:00
parent caf59d726f
commit 716a245397
2 changed files with 2 additions and 2 deletions

View File

@ -130,7 +130,7 @@ static bool _parsePacket(struct mVideoLogger* logger, const struct mVideoLoggerD
}
break;
case DIRTY_VRAM:
if (item->address + 0x1000 <= GB_SIZE_VRAM) {
if (item->address <= GB_SIZE_VRAM - 0x1000) {
logger->readData(logger, &logger->vram[item->address >> 1], 0x1000, true);
proxyRenderer->backend->writeVRAM(proxyRenderer->backend, item->address);
}

View File

@ -142,7 +142,7 @@ static bool _parsePacket(struct mVideoLogger* logger, const struct mVideoLoggerD
}
break;
case DIRTY_VRAM:
if (item->address + 0x1000 <= SIZE_VRAM) {
if (item->address <= SIZE_VRAM - 0x1000) {
logger->readData(logger, &logger->vram[item->address >> 1], 0x1000, true);
proxyRenderer->backend->writeVRAM(proxyRenderer->backend, item->address);
}