changeset 6813 | b21879e67db2 |
parent 6811 | 60d95fcfaf3c |
child 6885 | 700f1b25f77f |
1.1 --- a/src/events/SDL_keyboard.c Sun Jan 13 14:31:53 2013 -0800 1.2 +++ b/src/events/SDL_keyboard.c Sun Jan 13 22:55:26 2013 -0800 1.3 @@ -860,6 +860,11 @@ 1.4 SDL_GetKeyFromScancode(SDL_Scancode scancode) 1.5 { 1.6 SDL_Keyboard *keyboard = &SDL_keyboard; 1.7 + 1.8 + if (scancode<SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) { 1.9 + SDL_InvalidParamError("scancode"); 1.10 + return 0; 1.11 + } 1.12 1.13 return keyboard->keymap[scancode]; 1.14 }