Initialize the raw_map before getting controller mappings from the driver
authorSam Lantinga
Fri, 29 May 2020 14:48:39 -0700
changeset 138748f637851cd25
parent 13873 5bb6be4f2425
child 13875 83594183cff4
Initialize the raw_map before getting controller mappings from the driver
src/joystick/SDL_gamecontroller.c
     1.1 --- a/src/joystick/SDL_gamecontroller.c	Fri May 29 14:48:05 2020 -0700
     1.2 +++ b/src/joystick/SDL_gamecontroller.c	Fri May 29 14:48:39 2020 -0700
     1.3 @@ -1193,6 +1193,8 @@
     1.4      mapping = SDL_PrivateGetControllerMappingForNameAndGUID(name, guid);
     1.5      if (!mapping) {
     1.6          SDL_GamepadMapping raw_map;
     1.7 +
     1.8 +        SDL_zero(raw_map);
     1.9          if (SDL_PrivateJoystickGetAutoGamepadMapping(device_index, &raw_map)) {
    1.10              mapping = SDL_PrivateGenerateAutomaticControllerMapping(name, guid, &raw_map);
    1.11          }