summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2024-03-13 20:20:07 -0500
committerDudemanguy <random342@airmail.cc>2024-03-13 20:23:10 -0500
commit5dd2d19519a31998f2bea5c697a11d8c547b1e70 (patch)
tree69c8bd7e1569f85678d5704cf9b240040b21255d
parentf6f1721101e299b0989a631213375da73db719a2 (diff)
downloadmpv-5dd2d19519a31998f2bea5c697a11d8c547b1e70.tar.bz2
mpv-5dd2d19519a31998f2bea5c697a11d8c547b1e70.tar.xz
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.
-rw-r--r--video/out/wayland_common.c6
1 files 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,