aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-03-13 20:45:09 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-23 13:15:17 +0200
commit64b7716802e413fe0c3389c364f689f8b0ed80c9 (patch)
tree559c793243189ef4f12f5e6edd69fc11b774fa0e
parente695be347efa647f961e8502a21d11a81426cf2a (diff)
downloadffmpeg-64b7716802e413fe0c3389c364f689f8b0ed80c9.tar.gz
avcodec/mpegaudiodec_template: Make l3_unscale() work with e=0
Fixes undefined behavior Fixes: 830/clusterfuzz-testcase-6253175327686656 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 8ebed703f153e979edb2156754c8bdac4d5d6266) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/mpegaudiodec_template.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c
index a15bee557c..9f9e8bfe92 100644
--- a/libavcodec/mpegaudiodec_template.c
+++ b/libavcodec/mpegaudiodec_template.c
@@ -252,7 +252,7 @@ static inline int l3_unscale(int value, int exponent)
#endif
if (e > 31)
return 0;
- m = (m + (1 << (e - 1))) >> e;
+ m = (m + ((1U << e)>>1)) >> e;
return m;
}