diff options
author | wm4 <wm4@nowhere> | 2015-01-13 14:26:25 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-01-13 14:26:25 +0100 |
commit | 77b488b4a2f49408ecf872b2fd74ef0e23ec50a7 (patch) | |
tree | 532b923aa157577cfee4de054e59e1404eea3ccf /video/mp_image.c | |
parent | b2cc0fb1aef12254c69ab2e671c010b45b55fb0e (diff) | |
download | mpv-77b488b4a2f49408ecf872b2fd74ef0e23ec50a7.tar.bz2 mpv-77b488b4a2f49408ecf872b2fd74ef0e23ec50a7.tar.xz |
mp_image: reject invalid display aspect ratio
Having any of these set to 0 makes no sense.
I think some code might still be using 0/0 aspect ratio to signal unset
aspect ratio, but I didn't find it. If there is still code like this, it
should be fixed instead.
Fixes #1467.
Diffstat (limited to 'video/mp_image.c')
-rw-r--r-- | video/mp_image.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/video/mp_image.c b/video/mp_image.c index ac90fc1f79..95ed5ae08a 100644 --- a/video/mp_image.c +++ b/video/mp_image.c @@ -489,7 +489,7 @@ bool mp_image_params_valid(const struct mp_image_params *p) if (p->w < 0 || p->h < 0 || (p->w + 128LL) * (p->h + 128LL) >= INT_MAX / 8) return false; - if (p->d_w < 0 || p->d_h < 0) + if (p->d_w <= 0 || p->d_h <= 0) return false; if (p->rotate < 0 || p->rotate >= 360) |