SDL: Fix boundary conditions for joystick adjustments
Jeffrey Pfau jeffrey@endrift.com
Fri, 24 Apr 2015 00:07:18 -0700
2 files changed,
2 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -23,6 +23,7 @@ - Util: Fix resource leak in UTF-8 handling code
- VFS: Fix resource leaks if some allocations fail - Debugger: Fix boundary conditions in tab completion - Video: Fix an issue with very long filenames + - SDL: Fix boundary conditions for joystick adjustments Misc: - Qt: Show multiplayer numbers in window title - Qt: Solar sensor can have shortcuts set
M
src/platform/sdl/sdl-events.c
→
src/platform/sdl/sdl-events.c
@@ -190,7 +190,7 @@ }
} void GBASDLPlayerChangeJoystick(struct GBASDLEvents* events, struct GBASDLPlayer* player, size_t index) { - if (player->playerId > MAX_PLAYERS || index >= events->nJoysticks) { + if (player->playerId >= MAX_PLAYERS || index >= events->nJoysticks) { return; } events->joysticksClaimed[player->playerId] = index;