diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-28 21:57:11 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-29 03:34:22 +0200 |
commit | d42540499c51182175880dd83be1040bcb108609 (patch) | |
tree | 782cbe6398b31f2716bad5cf92f9202465ff0c16 | |
parent | eceea69567acc0d8f9368c300d9d52a3b1199512 (diff) | |
download | ffmpeg-d42540499c51182175880dd83be1040bcb108609.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 00b203182b..26321cef8e 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) |