diff --git a/CHANGES b/CHANGES index 4809f328d..abc9fdf4a 100644 --- a/CHANGES +++ b/CHANGES @@ -39,6 +39,7 @@ Bugfixes: - 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 diff --git a/src/platform/sdl/sdl-events.c b/src/platform/sdl/sdl-events.c index ed1629985..c14ec665c 100644 --- a/src/platform/sdl/sdl-events.c +++ b/src/platform/sdl/sdl-events.c @@ -304,7 +304,7 @@ void GBASDLPlayerSaveConfig(const struct GBASDLPlayer* context, struct Configura } 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;