diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-04-27 21:44:06 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-06-15 22:31:13 +0200 |
commit | 57bb78d980b83a579d8d41d0eac746a41d10b80f (patch) | |
tree | 8d911ff9c60d3c651e74a9ed031f5b8877c2e12d | |
parent | b2cb42f1c3dd7827160bb8062a0734bf11f4c7b6 (diff) | |
download | ffmpeg-57bb78d980b83a579d8d41d0eac746a41d10b80f.tar.gz |
avcodec/wavpack: Fix integer overflow in wv_unpack_stereo()
Fixes: runtime error: signed integer overflow: 2147483531 + 16384 cannot be represented in type 'int'
Fixes: 6615/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVPACK_fuzzer-5165715515506688
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 da038c07f02dfc10380001c11b3d047eca7cb8c9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/wavpack.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 0e40b29879..22a2c83a30 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -452,7 +452,7 @@ static inline int wv_unpack_stereo(WavpackFrameContext *s, GetBitContext *gb, if (type != AV_SAMPLE_FMT_S16P) R2 = R + ((s->decorr[i].weightB * (int64_t)L2 + 512) >> 10); else - R2 = R + ((int)(s->decorr[i].weightB * (unsigned)L2 + 512) >> 10); + R2 = R + (unsigned)((int)(s->decorr[i].weightB * (unsigned)L2 + 512) >> 10); UPDATE_WEIGHT_CLIP(s->decorr[i].weightB, s->decorr[i].delta, L2, R); R = R2; s->decorr[i].samplesA[0] = R; |