mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-07-07 19:45:00 +00:00
Add check for converting negative SDL_GameControllerButton to glyph
A SDL_GameControllerButton below 0 is out of array bounds, so that should trip the assert and return GLYPH_UNKNOWN just like when the value is too high.
This commit is contained in:
parent
d730528118
commit
37b788c1c8
1 changed files with 1 additions and 1 deletions
|
@ -274,7 +274,7 @@ const char* BUTTONGLYPHS_get_wasd_text(void)
|
||||||
|
|
||||||
const char* BUTTONGLYPHS_sdlbutton_to_glyph(const SDL_GameControllerButton button)
|
const char* BUTTONGLYPHS_sdlbutton_to_glyph(const SDL_GameControllerButton button)
|
||||||
{
|
{
|
||||||
if (button > SDL_CONTROLLER_BUTTON_RIGHTSHOULDER)
|
if (button < 0 || button > SDL_CONTROLLER_BUTTON_RIGHTSHOULDER)
|
||||||
{
|
{
|
||||||
SDL_assert(0 && "Unhandled button!");
|
SDL_assert(0 && "Unhandled button!");
|
||||||
return glyph[GLYPH_UNKNOWN];
|
return glyph[GLYPH_UNKNOWN];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue