# HG changeset patch # User Sam Lantinga # Date 1258305684 0 # Node ID daf9e6037596411eda1cc17836c31bf3e75e226f # Parent 6599c89de50c896c6c9d04a24fbd82b2b3ae3d8f 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. diff -r 6599c89de50c -r daf9e6037596 src/video/windx5/SDL_dx5events.c --- a/src/video/windx5/SDL_dx5events.c Mon Nov 09 18:02:32 2009 +0000 +++ b/src/video/windx5/SDL_dx5events.c Sun Nov 15 17:21:24 2009 +0000 @@ -559,13 +559,15 @@ active = (wParam && (GetForegroundWindow() == hwnd)); if ( active ) { - for ( i=0; SDL_DIdev[i]; ++i ) { - IDirectInputDevice2_Acquire( + for ( i=0; i