From 32c5b2c044604c5b1039035fd1f320c33988a2e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Mon, 25 Sep 2023 10:47:20 +0200 Subject: [PATCH] xwayland/present: Handle NULL window_priv in xwl_present_cleanup This can happen if the window has never completed a Present operation. Fixes: 42301760802e ("xwayland/present: Embed present_vblank_rec in xwl_present_event") --- hw/xwayland/xwayland-present.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c index 5ede33e4c..941be06da 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c @@ -414,9 +414,11 @@ xwl_present_cleanup(WindowPtr window) xwl_present_window->sync_callback = NULL; } - /* Clear remaining events */ - xorg_list_for_each_entry_safe(event, tmp, &window_priv->vblank, vblank.window_list) - xwl_present_free_event(event); + if (window_priv) { + /* Clear remaining events */ + xorg_list_for_each_entry_safe(event, tmp, &window_priv->vblank, vblank.window_list) + xwl_present_free_event(event); + } /* Clear timer */ xwl_present_free_timer(xwl_present_window);