GBA I/O: Fix writing to out-of-bounds 8-bit I/O registers
Jeffrey Pfau jeffrey@endrift.com
Wed, 28 Sep 2016 12:57:58 -0700
1 files changed,
3 insertions(+),
0 deletions(-)
jump to
M
src/gba/io.c
→
src/gba/io.c
@@ -567,6 +567,9 @@ GBAStop(gba);
} return; } + if (address > SIZE_IO) { + return; + } uint16_t value16 = value << (8 * (address & 1)); value16 |= (gba->memory.io[(address & (SIZE_IO - 1)) >> 1]) & ~(0xFF << (8 * (address & 1))); GBAIOWrite(gba, address & 0xFFFFFFFE, value16);