From fb6f92af7f437a6e44865188c4d22eaad19d4869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Thu, 31 Aug 2023 23:55:16 +0200 Subject: [PATCH] m_option: return empty rect when no width/height is available --- options/m_option.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/options/m_option.c b/options/m_option.c index b7cc4f7996..01f4da9195 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -2384,6 +2384,8 @@ const m_option_type_t m_option_type_size_box = { void m_rect_apply(struct mp_rect *rc, int w, int h, struct m_geometry *gm) { *rc = (struct mp_rect){0, 0, w, h}; + if (!w || !h) + return; m_geometry_apply(&rc->x0, &rc->y0, &rc->x1, &rc->y1, w, h, gm); if (!gm->xy_valid && gm->wh_valid && rc->x1 == 0 && rc->y1 == 0) return;