[FFmpeg-cvslog] avcodec/flacdec: avoid undefined shift
Michael Niedermayer
git at videolan.org
Wed Jan 31 02:19:20 EET 2018
ffmpeg | branch: release/3.4 | Michael Niedermayer <michael at niedermayer.cc> | Tue Dec 26 23:24:43 2017 +0100| [fb9560b366da69bd54011455c0c35303669e7ce6] | committer: Michael Niedermayer
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 at niedermayer.cc>
(cherry picked from commit 560daf88913b0de59a4d845bcd19254b406388dd)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fb9560b366da69bd54011455c0c35303669e7ce6
---
libavcodec/flacdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index 581c73efc8..5bbb8ee5b9 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -456,7 +456,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;
More information about the ffmpeg-cvslog
mailing list