summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-07-02 21:22:07 -0500
committerDudemanguy <random342@airmail.cc>2023-07-12 19:19:54 +0000
commit180a3df1f1a807ee79dd97e6883d2318a6285b71 (patch)
treed9af14782a939fba6b84f4005f307f7c4d02d647 /video/out
parenta890d7be2a940475e8d5dffd5eee1288383a9c31 (diff)
downloadmpv-180a3df1f1a807ee79dd97e6883d2318a6285b71.tar.bz2
mpv-180a3df1f1a807ee79dd97e6883d2318a6285b71.tar.xz
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.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/vo_dmabuf_wayland.c4
1 files changed, 2 insertions, 2 deletions
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",