all repos — mgba @ 877dbd38edf11f0359ed4c62419f8f29e065fb93

mGBA Game Boy Advance Emulator

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
commit

877dbd38edf11f0359ed4c62419f8f29e065fb93

parent

822c38bea82eafa2e1799ed7da80c8db9f64e1d3

1 files changed, 3 insertions(+), 0 deletions(-)

jump to
M src/gba/io.csrc/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);