Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Kenneth Bull to SDL
Browse files Browse the repository at this point in the history
I noticed in trunk/SDL/src/video/win32/SDL_win32events.c, in this code here...

... if the device handle isn't found in mice[], which it won't be if
the mouse was plugged in after SDL_Init, then you end up with an
uninitialized value in index, which is then passed to various
SDL_SendMouse* functions.
  • Loading branch information
slouken committed Sep 7, 2009
1 parent ab38969 commit 1c0e4e0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/video/win32/SDL_win32events.c
Expand Up @@ -236,7 +236,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
LPBYTE lpb;
const RAWINPUTHEADER *header;
int index;
int index = -1;
int i;
int size = 0;
const RAWMOUSE *raw_mouse = NULL;
Expand All @@ -261,6 +261,10 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
break;
}
}
if (index < 0) {
/* New mouse? Should we dynamically update mouse list? */
return (0);
}

GetCursorPos(&point);
ScreenToClient(hwnd, &point);
Expand Down

0 comments on commit 1c0e4e0

Please sign in to comment.