Add input validation to SDL_GetKeyFromScancode; fix compiler warning in testautomation driver on Linux; update keyboard test suite
This commit is contained in:
parent
175511b1a0
commit
3bc9dbe16c
3 changed files with 47 additions and 4 deletions
|
@ -860,6 +860,11 @@ SDL_Keycode
|
|||
SDL_GetKeyFromScancode(SDL_Scancode scancode)
|
||||
{
|
||||
SDL_Keyboard *keyboard = &SDL_keyboard;
|
||||
|
||||
if (scancode<SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) {
|
||||
SDL_InvalidParamError("scancode");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return keyboard->keymap[scancode];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue