allegro/src/keyboard.c: Avoid accessing out of range items in key/_key arrays

This commit is contained in:
David Capello 2013-12-29 19:52:21 -03:00
parent ab42d38947
commit fc58c24da2

View File

@ -492,6 +492,10 @@ void _handle_key_release(int scancode)
repeat_scan = -1;
}
ASSERT(scancode < KEY_MAX);
if (scancode >= KEY_MAX)
return;
if ((keyboard_driver->poll) || (!keyboard_polled)) {
/* process immediately */
key[scancode] = 0;