From ab3002851e4109e031c1b361f3afe8454cf7dee8 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sat, 8 Jul 2023 20:47:35 -0500 Subject: [PATCH] vo_wlshm: bail out of resize if width/height is 0 It can happen during initialization and of course nothing good will happen if we let this go through (i.e. segfault). Return and wait for geometry to finish setting up in the wayland stuff before doing the initial resize. --- video/out/vo_wlshm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/video/out/vo_wlshm.c b/video/out/vo_wlshm.c index 2ccdd7d681..1e5e009bc7 100644 --- a/video/out/vo_wlshm.c +++ b/video/out/vo_wlshm.c @@ -184,6 +184,10 @@ static int resize(struct vo *vo) struct vo_wayland_state *wl = vo->wl; const int32_t width = mp_rect_w(wl->geometry); const int32_t height = mp_rect_h(wl->geometry); + + if (width == 0 || height == 0) + return 1; + struct buffer *buf; vo_wayland_set_opaque_region(wl, false);