mirror of https://github.com/mpv-player/mpv
m_option: return empty rect when no width/height is available
This commit is contained in:
parent
10708c13fb
commit
fb6f92af7f
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue