mirror of https://github.com/mgba-emu/mgba.git
GBA: Fix unmapping values that are out of range
This commit is contained in:
parent
09db378531
commit
19eaba3cdd
|
@ -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) {
|
void GBAInputUnbindKey(struct GBAInputMap* map, uint32_t type, enum GBAKey input) {
|
||||||
struct GBAInputMapImpl* impl = _lookupMap(map, type);
|
struct GBAInputMapImpl* impl = _lookupMap(map, type);
|
||||||
|
if (input < 0 || input >= GBA_KEY_MAX) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (impl) {
|
if (impl) {
|
||||||
impl->map[input] = GBA_NO_MAPPING;
|
impl->map[input] = GBA_NO_MAPPING;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue