Skip to content

Commit

Permalink
Fixed bug 3438 - SDL_GameControllerEventWatcher: Log on event with va…
Browse files Browse the repository at this point in the history
…lue >= k_nMaxReverseEntries
  • Loading branch information
slouken committed Oct 8, 2016
1 parent 752931d commit 89abbbf
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/joystick/SDL_gamecontroller.c
Expand Up @@ -145,7 +145,11 @@ int SDL_GameControllerEventWatcher(void *userdata, SDL_Event * event)
{
SDL_GameController *controllerlist;

if (event->jaxis.axis >= k_nMaxReverseEntries) break;
if (event->jaxis.axis >= k_nMaxReverseEntries)
{
SDL_SetError("SDL_GameControllerEventWatcher: Axis index %d too large, ignoring motion", (int)event->jaxis.axis);
break;
}

controllerlist = SDL_gamecontrollers;
while (controllerlist) {
Expand Down Expand Up @@ -176,7 +180,11 @@ int SDL_GameControllerEventWatcher(void *userdata, SDL_Event * event)
{
SDL_GameController *controllerlist;

if (event->jbutton.button >= k_nMaxReverseEntries) break;
if (event->jbutton.button >= k_nMaxReverseEntries)
{
SDL_SetError("SDL_GameControllerEventWatcher: Button index %d too large, ignoring update", (int)event->jbutton.button);
break;
}

controllerlist = SDL_gamecontrollers;
while (controllerlist) {
Expand Down

0 comments on commit 89abbbf

Please sign in to comment.