From a8a4bcec362108bf41f34166e8fcff60e6ec7064 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Fri, 23 Feb 2024 18:29:21 +0100 Subject: [PATCH] wsi/wl: check wsi_wl_surface's validity before use Fixes: 9a00a360ad8 ("wsi/wl: flush connection on swapchain failure") Part-of: --- src/vulkan/wsi/wsi_common_wayland.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c index 26d9f922020..15c4d2342aa 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -2226,7 +2226,8 @@ wsi_wl_swapchain_chain_free(struct wsi_wl_swapchain *chain, * creation (see MAX_FDS_OUT) to avoid filling up VRAM with * released buffers. */ - wl_display_flush(chain->wsi_wl_surface->display->wl_display); + if (chain->wsi_wl_surface) + wl_display_flush(chain->wsi_wl_surface->display->wl_display); if (chain->frame) wl_callback_destroy(chain->frame);