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 89658eceea447276
parent 8964 d9ac759bb62a
child 8966 5771ab3290d6
Another fix to prevent dereferencing a null window pointer in SDL_mouse.c
src/events/SDL_mouse.c
     1.1 --- a/src/events/SDL_mouse.c	Sat Jun 28 12:48:29 2014 -0300
     1.2 +++ b/src/events/SDL_mouse.c	Sat Jun 28 12:50:17 2014 -0300
     1.3 @@ -248,7 +248,7 @@
     1.4  
     1.5      /* make sure that the pointers find themselves inside the windows,
     1.6         unless we have the mouse captured. */
     1.7 -    if ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0) {
     1.8 +    if (window != NULL && ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0)) {
     1.9          int x_max = 0, y_max = 0;
    1.10  
    1.11          // !!! FIXME: shouldn't this be (window) instead of (mouse->focus)?