Linux evdev: ignore joystick axis events if they aren't in a sane range. SDL-1.2
authorRyan C. Gordon <icculus@icculus.org>
Sun, 03 Jun 2012 04:49:25 -0400
branchSDL-1.2
changeset 6324 95abff7adcc2
parent 6306 2b923729fd01
child 6325 9cff1c7c0fff
Linux evdev: ignore joystick axis events if they aren't in a sane range.
src/joystick/linux/SDL_sysjoystick.c
--- a/src/joystick/linux/SDL_sysjoystick.c	Sat May 12 23:32:51 2012 -0700
+++ b/src/joystick/linux/SDL_sysjoystick.c	Sun Jun 03 04:49:25 2012 -0400
@@ -1106,6 +1106,9 @@
 				}
 				break;
 			    case EV_ABS:
+				if (code > ABS_MISC) {
+					break;
+				}
 				switch (code) {
 				    case ABS_HAT0X:
 				    case ABS_HAT0Y: