summaryrefslogtreecommitdiffstats
path: root/options/m_option.c
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-08-31 23:55:16 +0200
committerDudemanguy <random342@airmail.cc>2023-09-08 02:27:08 +0000
commitfb6f92af7f437a6e44865188c4d22eaad19d4869 (patch)
tree6a0958c31090b60c67ee63cfd958e936cc1e97dd /options/m_option.c
parent10708c13fbeb0b9a66790193bf15d51d6be4c68d (diff)
downloadmpv-fb6f92af7f437a6e44865188c4d22eaad19d4869.tar.bz2
mpv-fb6f92af7f437a6e44865188c4d22eaad19d4869.tar.xz
m_option: return empty rect when no width/height is available
Diffstat (limited to 'options/m_option.c')
-rw-r--r--options/m_option.c2
1 files changed, 2 insertions, 0 deletions
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;