Cygwin/X: Avoid a potential null pointer dereference before input initialization

Avoid a null pointer dereference if WM_MOUSEMOVE occurred before
the input device had been initialized (a timing sensitive bug
occassionally seen during initialization)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
Jon TURNEY 2009-10-03 12:44:50 +01:00
parent 1b0dfd8dee
commit 22b38f513c

View File

@ -717,6 +717,10 @@ winWindowProc (HWND hwnd, UINT message,
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
/* We can't do anything without g_pwinPointer */
if (g_pwinPointer == NULL)
break;
/* Has the mouse pointer crossed screens? */
if (s_pScreen != miPointerGetScreen(g_pwinPointer))
miPointerSetScreen (g_pwinPointer, s_pScreenInfo->dwScreen,