From db37d6e3b316fb5673acb46eeb81530e9722247d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 15 Nov 2009 17:21:24 +0000 Subject: [PATCH] Gregory Smith Another one for the "How did this ever work?" file: when DX5_HandleMessage is called with WM_ACTIVATEAPP, it goes past the end of the 2-element SDL_DIdev array and if there doesn't happen to be a 0 in the memory next to it, crashes. Patch against SVN attached. --HG-- branch : SDL-1.2 --- src/video/windx5/SDL_dx5events.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/video/windx5/SDL_dx5events.c b/src/video/windx5/SDL_dx5events.c index 65dac49cc..6d02593b1 100644 --- a/src/video/windx5/SDL_dx5events.c +++ b/src/video/windx5/SDL_dx5events.c @@ -559,13 +559,15 @@ LRESULT DX5_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar active = (wParam && (GetForegroundWindow() == hwnd)); if ( active ) { - for ( i=0; SDL_DIdev[i]; ++i ) { - IDirectInputDevice2_Acquire( + for ( i=0; i