From 1bb4c8f53ef7efb2c86b6929597fe37273472788 Mon Sep 17 00:00:00 2001 From: punkrockguy318 Date: Wed, 17 Feb 2010 05:51:32 +0000 Subject: [PATCH] SDL: bugfix - no longer crashes with invalid keys in fceux.cfg --- src/drivers/sdl/input.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/drivers/sdl/input.cpp b/src/drivers/sdl/input.cpp index 05f4f41b..8dbd6f9a 100644 --- a/src/drivers/sdl/input.cpp +++ b/src/drivers/sdl/input.cpp @@ -134,6 +134,9 @@ static uint8 keyonce[MKK_COUNT]; static int _keyonly(int a) { + // check for valid key + if(a > 350 || a < 0) + return(0); if(g_keyState[a]) { if(!keyonce[a]) { keyonce[a] = 1;