GBA: Fix unmapping values that are out of range

This commit is contained in:
Jeffrey Pfau 2015-01-25 03:34:14 -08:00
parent 09db378531
commit 19eaba3cdd
1 changed files with 3 additions and 0 deletions

View File

@ -312,6 +312,9 @@ void GBAInputBindKey(struct GBAInputMap* map, uint32_t type, int key, enum GBAKe
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;
}