aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-12-26 23:24:43 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-12-28 20:27:03 +0100
commit5d18394d089cbdf04c04484c9bdac21334a00aa4 (patch)
treed2026764ba08c48a412175cad580bb0893752d90
parent52b7672ef65407ea32b6f17262712ddb894acd73 (diff)
downloadffmpeg-5d18394d089cbdf04c04484c9bdac21334a00aa4.tar.gz
avcodec/flacdec: avoid undefined shift
Fixes: shift exponent 32 is too large for 32-bit type 'unsigned int' Fixes: 4688/clusterfuzz-testcase-minimized-6572210748653568 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 560daf88913b0de59a4d845bcd19254b406388dd) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/flacdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index ad9ee071c5..efd017fb52 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -403,7 +403,7 @@ static inline int decode_subframe(FLACContext *s, int channel)
return AVERROR_INVALIDDATA;
}
- if (wasted) {
+ if (wasted && wasted < 32) {
int i;
for (i = 0; i < s->blocksize; i++)
decoded[i] = (unsigned)decoded[i] << wasted;