all repos — mgba @ d091de405744fee93eacfe55106ead3b2a03f16e

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

d091de405744fee93eacfe55106ead3b2a03f16e

parent

104a80422c57ef225429ea0f93e737f07c4aa01c

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

jump to
M CHANGESCHANGES

@@ -39,6 +39,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: Handle saving input settings better
M src/platform/sdl/sdl-events.csrc/platform/sdl/sdl-events.c

@@ -304,7 +304,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;