GB, GBA Video: Fix integer overflow
Vicki Pfau vi@endrift.com
Tue, 18 Apr 2017 04:02:44 -0700
2 files changed,
2 insertions(+),
2 deletions(-)
M
src/gb/renderers/proxy.c
→
src/gb/renderers/proxy.c
@@ -130,7 +130,7 @@ proxyRenderer->backend->writeOAM(proxyRenderer->backend, item->address);
} 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); }
M
src/gba/renderers/proxy.c
→
src/gba/renderers/proxy.c
@@ -142,7 +142,7 @@ proxyRenderer->backend->writeOAM(proxyRenderer->backend, item->address);
} 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); }