[FFmpeg-cvslog] avcodec/wavpack: Fix runtime error: left shift of negative value -2
Michael Niedermayer
git at videolan.org
Sun Mar 5 14:21:27 EET 2017
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Mar 4 04:55:15 2017 +0100| [ba150051322c02e24c004bd5309468886e1e5ab6] | committer: Michael Niedermayer
avcodec/wavpack: Fix runtime error: left shift of negative value -2
Fixes: 723/clusterfuzz-testcase-6471394663596032
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ba150051322c02e24c004bd5309468886e1e5ab6
---
libavcodec/wavpack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index bf538a9..a4ba07f 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -745,13 +745,13 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
}
for (i = 0; i < weights; i++) {
t = (int8_t)bytestream2_get_byte(&gb);
- s->decorr[s->terms - i - 1].weightA = t << 3;
+ s->decorr[s->terms - i - 1].weightA = t * (1 << 3);
if (s->decorr[s->terms - i - 1].weightA > 0)
s->decorr[s->terms - i - 1].weightA +=
(s->decorr[s->terms - i - 1].weightA + 64) >> 7;
if (s->stereo_in) {
t = (int8_t)bytestream2_get_byte(&gb);
- s->decorr[s->terms - i - 1].weightB = t << 3;
+ s->decorr[s->terms - i - 1].weightB = t * (1 << 3);
if (s->decorr[s->terms - i - 1].weightB > 0)
s->decorr[s->terms - i - 1].weightB +=
(s->decorr[s->terms - i - 1].weightB + 64) >> 7;
More information about the ffmpeg-cvslog
mailing list