[FFmpeg-cvslog] avutil/imgutils: correctly check for negative SAR components
Michael Niedermayer
git at videolan.org
Sat Mar 21 02:30:08 CET 2015
ffmpeg | branch: release/2.5 | Michael Niedermayer <michaelni at gmx.at> | Sat Feb 28 21:57:11 2015 +0100| [3791436eb58822f3af9c5fb4de744e7523b7046e] | committer: Michael Niedermayer
avutil/imgutils: correctly check for negative SAR components
These could trigger assert failures previously
Found-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 5705dc527687fd84d94c934169b6bd753459744f)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3791436eb58822f3af9c5fb4de744e7523b7046e
---
libavutil/imgutils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
index 7f3032b..a12079d 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)
More information about the ffmpeg-cvslog
mailing list