[gtk/gtk-3-24: 1/2] fix(dereference NULL ptr): Also tests "impl" in gdk_x11_device_xi2_window_at_position




commit 0081dfc51df3a6d2a1cc94e0e498c87a0a4c1873
Author: Thibaud CANALE <thican thican net>
Date:   Sun Jan 23 03:07:53 2022 +0100

    fix(dereference NULL ptr): Also tests "impl" in gdk_x11_device_xi2_window_at_position
    
    Signed-off-by: Thibaud CANALE <thican thican net>

 gdk/x11/gdkdevice-xi2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c
index f089a56b5e..92c78e68d5 100644
--- a/gdk/x11/gdkdevice-xi2.c
+++ b/gdk/x11/gdkdevice-xi2.c
@@ -657,10 +657,10 @@ gdk_x11_device_xi2_window_at_position (GdkDevice       *device,
     }
 
   if (win_x)
-    *win_x = (window) ? (xwin_x / impl->window_scale) : -1;
+    *win_x = (window && impl) ? (xwin_x / impl->window_scale) : -1;
 
   if (win_y)
-    *win_y = (window) ? (xwin_y / impl->window_scale) : -1;
+    *win_y = (window && impl) ? (xwin_y / impl->window_scale) : -1;
 
 
   return window;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]