From 5dd2d19519a31998f2bea5c697a11d8c547b1e70 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Wed, 13 Mar 2024 20:20:07 -0500 Subject: wayland_common: move WAYLAND_DISPLAY check above vo_wayland_state init Segfaults otherwise on uninit because some objects are created while others are not. Move it to the very top since the purpose of this is to skip wayland initialization entirely while autoprobing. Fixes f6f1721101e299b0989a631213375da73db719a2. --- video/out/wayland_common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index cc214a6e8d..cab1245ff4 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -2422,12 +2422,12 @@ void vo_wayland_handle_scale(struct vo_wayland_state *wl) bool vo_wayland_init(struct vo *vo) { - vo->wl = talloc_zero(NULL, struct vo_wayland_state); - struct vo_wayland_state *wl = vo->wl; - if (!getenv("WAYLAND_DISPLAY")) goto err; + vo->wl = talloc_zero(NULL, struct vo_wayland_state); + struct vo_wayland_state *wl = vo->wl; + *wl = (struct vo_wayland_state) { .display = wl_display_connect(NULL), .vo = vo, -- cgit v1.2.3