src/joystick/SDL_gamecontroller.c
changeset 10495 f732781d7ddc
parent 10477 dc4bec0fc176
child 10595 9da2701eeb4a
     1.1 --- a/src/joystick/SDL_gamecontroller.c	Mon Oct 03 11:35:34 2016 +0100
     1.2 +++ b/src/joystick/SDL_gamecontroller.c	Fri Oct 07 18:24:34 2016 -0700
     1.3 @@ -145,7 +145,11 @@
     1.4          {
     1.5              SDL_GameController *controllerlist;
     1.6  
     1.7 -            if (event->jaxis.axis >= k_nMaxReverseEntries) break;
     1.8 +            if (event->jaxis.axis >= k_nMaxReverseEntries)
     1.9 +            {
    1.10 +                SDL_SetError("SDL_GameControllerEventWatcher: Axis index %d too large, ignoring motion", (int)event->jaxis.axis);
    1.11 +                break;
    1.12 +            }
    1.13  
    1.14              controllerlist = SDL_gamecontrollers;
    1.15              while (controllerlist) {
    1.16 @@ -176,7 +180,11 @@
    1.17          {
    1.18              SDL_GameController *controllerlist;
    1.19  
    1.20 -            if (event->jbutton.button >= k_nMaxReverseEntries) break;
    1.21 +            if (event->jbutton.button >= k_nMaxReverseEntries)
    1.22 +            {
    1.23 +                SDL_SetError("SDL_GameControllerEventWatcher: Button index %d too large, ignoring update", (int)event->jbutton.button);
    1.24 +                break;
    1.25 +            }
    1.26  
    1.27              controllerlist = SDL_gamecontrollers;
    1.28              while (controllerlist) {