diff options
author | Wim Taymans <wtaymans@redhat.com> | 2019-11-12 17:17:50 +0100 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2019-11-12 17:17:50 +0100 |
commit | fa08814cfeeb41b2a8d119f67888681760e64964 (patch) | |
tree | e28cffcb27136af090d069768ce24af9a7fc50bd | |
parent | 3af07e979429c8692b8b2a065c17aa8a4ff2d7a2 (diff) |
SDL_sysjoystick.c: make sure we don't overread abs_map
Ensure the code is within the abs_map array bounds before using
it as an index.
-rw-r--r-- | src/joystick/linux/SDL_sysjoystick.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c index 6bd5330b4c..72f52cb273 100644 --- a/src/joystick/linux/SDL_sysjoystick.c +++ b/src/joystick/linux/SDL_sysjoystick.c @@ -919,7 +919,7 @@ HandleInputEvents(SDL_Joystick * joystick) HandleHat(joystick, joystick->hwdata->hats_indices[code / 2], code % 2, events[i].value); break; default: - if (joystick->hwdata->abs_map[code] != 0xFF) { + if (code < ABS_MAX && joystick->hwdata->abs_map[code] != 0xFF) { events[i].value = AxisCorrect(joystick, code, events[i].value); SDL_PrivateJoystickAxis(joystick, |