From 529fae91f7bd8d810a7650e203bc5be9431af860 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Mon, 10 May 2021 12:29:58 +0300 Subject: [PATCH] backend-wayland: Avoid iterating over un-intialized lists As an in-flight resize call might cause a call to wayland_output_destroy_shm_buffers() to go over a list of free_buffers list. Just initialize the lists before attempting to create the parent surface to avoid it. Signed-off-by: Marius Vlad --- libweston/backend-wayland/wayland.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libweston/backend-wayland/wayland.c b/libweston/backend-wayland/wayland.c index f58bba46..68a4ff1a 100644 --- a/libweston/backend-wayland/wayland.c +++ b/libweston/backend-wayland/wayland.c @@ -1239,6 +1239,9 @@ wayland_output_enable(struct weston_output *base) enum mode_status mode_status; int ret = 0; + wl_list_init(&output->shm.buffers); + wl_list_init(&output->shm.free_buffers); + weston_log("Creating %dx%d wayland output at (%d, %d)\n", output->base.current_mode->width, output->base.current_mode->height, @@ -1250,9 +1253,6 @@ wayland_output_enable(struct weston_output *base) if (ret < 0) return -1; - wl_list_init(&output->shm.buffers); - wl_list_init(&output->shm.free_buffers); - if (b->use_pixman) { if (wayland_output_init_pixman_renderer(output) < 0) goto err_output;