all repos — mgba @ 716a2453978d149291f9b88caff36f06fa227e95

mGBA Game Boy Advance Emulator

GB, GBA Video: Fix integer overflow
Vicki Pfau vi@endrift.com
Tue, 18 Apr 2017 04:02:44 -0700
commit

716a2453978d149291f9b88caff36f06fa227e95

parent

caf59d726f5e8e4b9269e7ada8bc9c59831b08bb

2 files changed, 2 insertions(+), 2 deletions(-)

jump to
M src/gb/renderers/proxy.csrc/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.csrc/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); }