From 39c958bbaaf00069a42942c7c1b23df24eabaabc Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 29 May 2020 14:48:39 -0700 Subject: [PATCH] Initialize the raw_map before getting controller mappings from the driver --- src/joystick/SDL_gamecontroller.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c index 9bf688acf..80a6d0397 100644 --- a/src/joystick/SDL_gamecontroller.c +++ b/src/joystick/SDL_gamecontroller.c @@ -1193,6 +1193,8 @@ static ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index) mapping = SDL_PrivateGetControllerMappingForNameAndGUID(name, guid); if (!mapping) { SDL_GamepadMapping raw_map; + + SDL_zero(raw_map); if (SDL_PrivateJoystickGetAutoGamepadMapping(device_index, &raw_map)) { mapping = SDL_PrivateGenerateAutomaticControllerMapping(name, guid, &raw_map); }