Skip to content

Commit

Permalink
Initialize the raw_map before getting controller mappings from the dr…
Browse files Browse the repository at this point in the history
…iver
  • Loading branch information
slouken committed May 29, 2020
1 parent 2db0494 commit 39c958b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/joystick/SDL_gamecontroller.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit 39c958b

Please sign in to comment.