m_option: return empty rect when no width/height is available

This commit is contained in:
Kacper Michajłow 2023-08-31 23:55:16 +02:00 committed by Dudemanguy
parent 10708c13fb
commit fb6f92af7f
1 changed files with 2 additions and 0 deletions

View File

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