1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-07 15:41:55 +00:00

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.
This commit is contained in:
Dudemanguy 2023-07-08 20:47:35 -05:00
parent 0242055564
commit ab3002851e

View File

@ -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);