# HG changeset patch # User Michael Pavone # Date 1751689428 25200 # Node ID 0a6d644c47aae24b231852e27d59c4b3b75d37f3 # Parent 5ca4e0fd761ba3a53df3448ec83bbb676b68b42b Avoid crash if using an older SDL2 DLL than the one we compiled with diff -r 5ca4e0fd761b -r 0a6d644c47aa render_sdl.c --- a/render_sdl.c Fri Jul 04 19:35:50 2025 -0700 +++ b/render_sdl.c Fri Jul 04 21:23:48 2025 -0700 @@ -2636,7 +2636,10 @@ if (!button_lookup) { for (int i = SDL_CONTROLLER_BUTTON_A; i < SDL_CONTROLLER_BUTTON_MAX; i++) { - button_lookup = tern_insert_int(button_lookup, SDL_GameControllerGetStringForButton(i), i); + const char *bname = SDL_GameControllerGetStringForButton(i); + if (bname) { + button_lookup = tern_insert_int(button_lookup, bname, i); + } } //alternative Playstation-style names button_lookup = tern_insert_int(button_lookup, "cross", SDL_CONTROLLER_BUTTON_A);