summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-13 14:26:25 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-01-25 17:00:08 +0900
commitfaf561c4ec3192e0dcef243110c88799cf4dee6a (patch)
treeca30aad70394c8efb57af1bb81425fbdd81c5ffe
parent8c54b56f4339ae897e90a8f75a821d4b29a9d210 (diff)
downloadmpv-faf561c4ec3192e0dcef243110c88799cf4dee6a.tar.bz2
mpv-faf561c4ec3192e0dcef243110c88799cf4dee6a.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.
-rw-r--r--video/mp_image.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/video/mp_image.c b/video/mp_image.c
index abf608d1fe..33bbd31668 100644
--- a/video/mp_image.c
+++ b/video/mp_image.c
@@ -496,7 +496,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)