瀏覽代碼

Another fix to prevent dereferencing a null window pointer in SDL_mouse.c

Gabriel Jacobo 12 年之前
父節點
當前提交
9dc2614e7d
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/events/SDL_mouse.c

+ 1 - 1
src/events/SDL_mouse.c

@@ -248,7 +248,7 @@ SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relativ
 
 
     /* make sure that the pointers find themselves inside the windows,
     /* make sure that the pointers find themselves inside the windows,
        unless we have the mouse captured. */
        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;
         int x_max = 0, y_max = 0;
 
 
         // !!! FIXME: shouldn't this be (window) instead of (mouse->focus)?
         // !!! FIXME: shouldn't this be (window) instead of (mouse->focus)?