Wayland: Avoid NULL dereference after window destruction (thanks, "x414e54"!).
authorRyan C. Gordon
Wed, 27 May 2015 18:54:06 -0400
changeset 96555c55c6567bdc
parent 9654 b9488c689ce3
child 9656 8a4bcbdeba1c
Wayland: Avoid NULL dereference after window destruction (thanks, "x414e54"!).

Fixes Bugzilla #2934.
src/video/wayland/SDL_waylandevents.c
     1.1 --- a/src/video/wayland/SDL_waylandevents.c	Wed May 27 10:29:43 2015 -0700
     1.2 +++ b/src/video/wayland/SDL_waylandevents.c	Wed May 27 18:54:06 2015 -0400
     1.3 @@ -293,6 +293,12 @@
     1.4                        struct wl_array *keys)
     1.5  {
     1.6      struct SDL_WaylandInput *input = data;
     1.7 +
     1.8 +    if (!surface) {
     1.9 +        /* enter event for a window we've just destroyed */
    1.10 +        return;
    1.11 +    }
    1.12 + 
    1.13      SDL_WindowData *window = wl_surface_get_user_data(surface);
    1.14  
    1.15      input->keyboard_focus = window;