From 4a256484253a2de98a622fc9dad99afcbfdc8400 Mon Sep 17 00:00:00 2001 From: Nate Weibley Date: Fri, 13 Jan 2017 14:45:22 -0500 Subject: [PATCH] Condition SDL counts so we don't pass negative numbers to new Should address #4425 --- src/Joystick/JoystickSDL.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Joystick/JoystickSDL.cc b/src/Joystick/JoystickSDL.cc index c23448026..854ac4407 100644 --- a/src/Joystick/JoystickSDL.cc +++ b/src/Joystick/JoystickSDL.cc @@ -49,7 +49,7 @@ QMap JoystickSDL::discover(MultiVehicleManager* _multiVehicl SDL_JoystickClose(sdlJoystick); qCDebug(JoystickLog) << "\t" << name << "axes:" << axisCount << "buttons:" << buttonCount << "hats:" << hatCount << "isGC:" << isGameController; - ret[name] = new JoystickSDL(name, axisCount, buttonCount, hatCount, i, isGameController, _multiVehicleManager); + ret[name] = new JoystickSDL(name, qMax(0,axisCount), qMax(0,buttonCount), qMax(0,hatCount), i, isGameController, _multiVehicleManager); } else { qCDebug(JoystickLog) << "\tSkipping duplicate" << name; } -- 2.22.0