summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-07-08 20:47:35 -0500
committerDudemanguy <random342@airmail.cc>2023-07-08 20:47:35 -0500
commitab3002851e4109e031c1b361f3afe8454cf7dee8 (patch)
treed40c37256b60531bcc4731aba80867e9cd0e0aed /video/out
parent024205556448393e64e5020e41e7be498535c566 (diff)
downloadmpv-ab3002851e4109e031c1b361f3afe8454cf7dee8.tar.bz2
mpv-ab3002851e4109e031c1b361f3afe8454cf7dee8.tar.xz
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.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/vo_wlshm.c4
1 files changed, 4 insertions, 0 deletions
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);