From 70a41f9bc200f6358ec225545243e8a24eccbeb7 Mon Sep 17 00:00:00 2001 From: Guldoman Date: Tue, 1 Nov 2022 09:59:16 +0100 Subject: [PATCH] wayland: Read `window` data only if `window` is valid --- src/video/wayland/SDL_waylandevents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 5d8cdb1fd..00563c8f1 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -590,11 +590,11 @@ pointer_handle_button_common(struct SDL_WaylandInput *input, uint32_t serial, uint32_t time, uint32_t button, uint32_t state_w) { SDL_WindowData *window = input->pointer_focus; - SDL_VideoData *viddata = window->waylandData; enum wl_pointer_button_state state = state_w; uint32_t sdl_button; if (window) { + SDL_VideoData *viddata = window->waylandData; switch (button) { case BTN_LEFT: sdl_button = SDL_BUTTON_LEFT;