mirror of
https://github.com/yawut/SDL.git
synced 2026-07-18 17:01:19 -05:00
Kenneth Bull to SDL
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.
This commit is contained in:
parent
30ebf925f0
commit
8bc4d1a94e
|
|
@ -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;
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user