Another fix to prevent dereferencing a null window pointer in SDL_mouse.c
authorGabriel Jacobo <gabomdq@gmail.com>
Sat, 28 Jun 2014 12:50:17 -0300
changeset 8965 8eceea447276
parent 8964 d9ac759bb62a
child 8966 5771ab3290d6
Another fix to prevent dereferencing a null window pointer in SDL_mouse.c
src/events/SDL_mouse.c
--- a/src/events/SDL_mouse.c	Sat Jun 28 12:48:29 2014 -0300
+++ b/src/events/SDL_mouse.c	Sat Jun 28 12:50:17 2014 -0300
@@ -248,7 +248,7 @@
 
     /* make sure that the pointers find themselves inside the windows,
        unless we have the mouse captured. */
-    if ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0) {
+    if (window != NULL && ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0)) {
         int x_max = 0, y_max = 0;
 
         // !!! FIXME: shouldn't this be (window) instead of (mouse->focus)?