[FFmpeg-cvslog] avcodec/mpegaudiodec_template: Check for negative e

Michael Niedermayer git at videolan.org
Fri Mar 10 00:35:29 EET 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Mar  8 21:25:13 2017 +0100| [58dd25f8adb151a59971daa94d352d3226d2dbb6] | committer: Michael Niedermayer

avcodec/mpegaudiodec_template: Check for negative e

Fixes: undefined shift
Fixes: 631/clusterfuzz-testcase-6725491035734016

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58dd25f8adb151a59971daa94d352d3226d2dbb6
---

 libavcodec/mpegaudiodec_template.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c
index a3729a9..88f6272 100644
--- a/libavcodec/mpegaudiodec_template.c
+++ b/libavcodec/mpegaudiodec_template.c
@@ -251,7 +251,7 @@ static inline int l3_unscale(int value, int exponent)
     if(e < 1)
         av_log(NULL, AV_LOG_WARNING, "l3_unscale: e is %d\n", e);
 #endif
-    if (e > 31)
+    if (e > (SUINT)31)
         return 0;
     m = (m + (1 << (e - 1))) >> e;
 



More information about the ffmpeg-cvslog mailing list