all repos — mgba @ 745aab78d17872c61a585df31ee53ac459eeba14

mGBA Game Boy Advance Emulator

SDL: Fix boundary conditions for joystick adjustments
Jeffrey Pfau jeffrey@endrift.com
Fri, 24 Apr 2015 00:07:18 -0700
commit

745aab78d17872c61a585df31ee53ac459eeba14

parent

248dbba88d0897490a46b8fcc069c144088b7cb3

2 files changed, 2 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.csrc/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;