mirror of https://github.com/mpv-player/mpv
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.
This commit is contained in:
parent
a890d7be2a
commit
180a3df1f1
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue