[FFmpeg-cvslog] avcodec/wavpack: Fix runtime error: shift exponent 32 is too large for 32-bit type 'int'

Michael Niedermayer git at videolan.org
Wed Jun 7 01:03:50 EEST 2017


ffmpeg | branch: release/3.3 | Michael Niedermayer <michael at niedermayer.cc> | Thu Jun  1 18:48:37 2017 +0200| [3dc62e679ab2ed88b7fe4a5e691dba3874d62a22] | committer: Michael Niedermayer

avcodec/wavpack: Fix runtime error: shift exponent 32 is too large for 32-bit type 'int'

Fixes: 1967/clusterfuzz-testcase-minimized-5757031199801344

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 8b3e580b7f436206e84dac89415e057fa9abdab8)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3dc62e679ab2ed88b7fe4a5e691dba3874d62a22
---

 libavcodec/wavpack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 83e5c906cf..ba5fa7a266 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -188,7 +188,7 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb,
                     goto error;
                 t += t2;
             } else {
-                if (get_bits_left(gb) < t2 - 1)
+                if (t2 >= 32 || get_bits_left(gb) < t2 - 1)
                     goto error;
                 t += get_bits_long(gb, t2 - 1) | (1 << (t2 - 1));
             }



More information about the ffmpeg-cvslog mailing list