diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-28 21:57:11 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-21 01:52:51 +0100 |
commit | 3791436eb58822f3af9c5fb4de744e7523b7046e (patch) | |
tree | 900080f52df078275e0696c3cd37d61e1f0dc92d | |
parent | 61147f58ab6a212fdc1a1e1da68778f8640356a4 (diff) | |
download | ffmpeg-3791436eb58822f3af9c5fb4de744e7523b7046e.tar.gz |
avutil/imgutils: correctly check for negative SAR components
These could trigger assert failures previously
Found-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5705dc527687fd84d94c934169b6bd753459744f)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavutil/imgutils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c index 7f3032bdf3..a12079d228 100644 --- a/libavutil/imgutils.c +++ b/libavutil/imgutils.c @@ -245,7 +245,7 @@ int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar) { int64_t scaled_dim; - if (!sar.den) + if (sar.den <= 0 || sar.num < 0) return AVERROR(EINVAL); if (!sar.num || sar.num == sar.den) |