[FFmpeg-cvslog] avcodec/wavpack: Check float_shift
Michael Niedermayer
git at videolan.org
Tue Jun 6 01:08:19 EEST 2017
ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Tue May 30 03:13:21 2017 +0200| [3a56bbe001fcd18faf7d5a05473447e54556797c] | committer: Michael Niedermayer
avcodec/wavpack: Check float_shift
Fixes: runtime error: shift exponent 40 is too large for 32-bit type 'unsigned int'
Fixes: 1898/clusterfuzz-testcase-minimized-5970744880136192
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 4020b009d1e88ff10abd25fb768165afa546851d)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3a56bbe001fcd18faf7d5a05473447e54556797c
---
libavcodec/wavpack.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 9ea72c4b84..614d5a3283 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -870,6 +870,12 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
s->float_flag = bytestream2_get_byte(&gb);
s->float_shift = bytestream2_get_byte(&gb);
s->float_max_exp = bytestream2_get_byte(&gb);
+ if (s->float_shift > 31) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Invalid FLOATINFO, shift = %d (> 31)\n", s->float_shift);
+ s->float_shift = 0;
+ continue;
+ }
got_float = 1;
bytestream2_skip(&gb, 1);
break;
More information about the ffmpeg-cvslog
mailing list