From 180a3df1f1a807ee79dd97e6883d2318a6285b71 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sun, 2 Jul 2023 21:22:07 -0500 Subject: vo_dmabuf_wayland: init wl_list at the top of preinit Otherwise, we could fail and skip to uninit without initalizing this which then will segfault because the list is null and accessed while trying to destroy buffers. --- video/out/vo_dmabuf_wayland.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'video/out') diff --git a/video/out/vo_dmabuf_wayland.c b/video/out/vo_dmabuf_wayland.c index 2f9e41f1b0..92a3aaa7eb 100644 --- a/video/out/vo_dmabuf_wayland.c +++ b/video/out/vo_dmabuf_wayland.c @@ -467,11 +467,11 @@ static int preinit(struct vo *vo) p->log = vo->log; p->global = vo->global; p->ctx = ra_ctx_create_by_name(vo, "wldmabuf"); + wl_list_init(&p->buffer_list); if (!p->ctx) goto err; - assert(p->ctx->ra); - wl_list_init(&p->buffer_list); + assert(p->ctx->ra); if (!vo->wl->dmabuf || !vo->wl->dmabuf_feedback) { MP_FATAL(vo->wl, "Compositor doesn't support the %s (ver. 4) protocol!\n", -- cgit v1.2.3