avcodec/mpegaudiodec_template: Check for negative e
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 8 Mar 2017 20:25:13 +0000 (21:25 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 9 Mar 2017 19:37:10 +0000 (20:37 +0100)
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@niedermayer.cc>
libavcodec/mpegaudiodec_template.c

index a3729a9..88f6272 100644 (file)
@@ -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;