SDL: bugfix - no longer crashes with invalid keys in fceux.cfg

This commit is contained in:
punkrockguy318 2010-02-17 05:51:32 +00:00
parent 236708f9b8
commit 1bb4c8f53e
1 changed files with 3 additions and 0 deletions

View File

@ -134,6 +134,9 @@ static uint8 keyonce[MKK_COUNT];
static int static int
_keyonly(int a) _keyonly(int a)
{ {
// check for valid key
if(a > 350 || a < 0)
return(0);
if(g_keyState[a]) { if(g_keyState[a]) {
if(!keyonce[a]) { if(!keyonce[a]) {
keyonce[a] = 1; keyonce[a] = 1;