Wayland: Avoid NULL dereference after window destruction (thanks, "x414e54"!).
authorRyan C. Gordon <icculus@icculus.org>
Wed, 27 May 2015 18:54:06 -0400
changeset 9655 5c55c6567bdc
parent 9654 b9488c689ce3
child 9656 8a4bcbdeba1c
Wayland: Avoid NULL dereference after window destruction (thanks, "x414e54"!). Fixes Bugzilla #2934.
src/video/wayland/SDL_waylandevents.c
--- a/src/video/wayland/SDL_waylandevents.c	Wed May 27 10:29:43 2015 -0700
+++ b/src/video/wayland/SDL_waylandevents.c	Wed May 27 18:54:06 2015 -0400
@@ -293,6 +293,12 @@
                       struct wl_array *keys)
 {
     struct SDL_WaylandInput *input = data;
+
+    if (!surface) {
+        /* enter event for a window we've just destroyed */
+        return;
+    }
+ 
     SDL_WindowData *window = wl_surface_get_user_data(surface);
 
     input->keyboard_focus = window;