all repos — mgba @ 19eaba3cddda1765839a9f17df08f0fc17e98d5d

mGBA Game Boy Advance Emulator

GBA: Fix unmapping values that are out of range
Jeffrey Pfau jeffrey@endrift.com
Sun, 25 Jan 2015 03:34:14 -0800
commit

19eaba3cddda1765839a9f17df08f0fc17e98d5d

parent

09db378531bfe16c736f20cd62c79aa91d19b9d0

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

jump to
M src/gba/gba-input.csrc/gba/gba-input.c

@@ -312,6 +312,9 @@ }

void GBAInputUnbindKey(struct GBAInputMap* map, uint32_t type, enum GBAKey input) { struct GBAInputMapImpl* impl = _lookupMap(map, type); + if (input < 0 || input >= GBA_KEY_MAX) { + return; + } if (impl) { impl->map[input] = GBA_NO_MAPPING; }