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;