GBA: Fix unmapping values that are out of range
Jeffrey Pfau jeffrey@endrift.com
Sun, 25 Jan 2015 03:34:14 -0800
1 files changed,
3 insertions(+),
0 deletions(-)
jump to
M
src/gba/gba-input.c
→
src/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; }