D'oh; missed a check in previous patch
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2660 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -209,7 +209,7 @@ TFB_InitInput (int driver, int flags)
|
||||
|
||||
SDL_EnableUNICODE(1);
|
||||
(void)SDL_GetKeyState (&num_keys);
|
||||
kbdstate = (int *)HMalloc (sizeof (int) * num_keys);
|
||||
kbdstate = (int *)HMalloc (sizeof (int) * (num_keys + 1));
|
||||
|
||||
|
||||
#ifdef HAVE_JOYSTICK
|
||||
@@ -327,8 +327,8 @@ ProcessInputEvent (const SDL_Event *Event)
|
||||
SDLKey k = Event->key.keysym.sym;
|
||||
wchar_t map_key = Event->key.keysym.unicode;
|
||||
|
||||
if (k < 0 || k > SDLK_LAST)
|
||||
k = SDLK_LAST; // for unknown keys
|
||||
if (k < 0 || k > num_keys)
|
||||
k = num_keys; // for unknown keys
|
||||
|
||||
if (Event->type == SDL_KEYDOWN)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user