SDL-1.2.15-ignore_insane_joystick_axis.patch 667 B

123456789101112131415161718192021
  1. changeset: 6324:95abff7adcc2
  2. branch: SDL-1.2
  3. parent: 6306:2b923729fd01
  4. user: Ryan C. Gordon <icculus@icculus.org>
  5. date: Sun Jun 03 04:49:25 2012 -0400
  6. summary: Linux evdev: ignore joystick axis events if they aren't in a sane range.
  7. diff -r 2b923729fd01 -r 95abff7adcc2 src/joystick/linux/SDL_sysjoystick.c
  8. --- a/src/joystick/linux/SDL_sysjoystick.c Sat May 12 23:32:51 2012 -0700
  9. +++ b/src/joystick/linux/SDL_sysjoystick.c Sun Jun 03 04:49:25 2012 -0400
  10. @@ -1106,6 +1106,9 @@
  11. }
  12. break;
  13. case EV_ABS:
  14. + if (code > ABS_MISC) {
  15. + break;
  16. + }
  17. switch (code) {
  18. case ABS_HAT0X:
  19. case ABS_HAT0Y: