diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-09-22 20:45:26 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-09-25 11:09:10 +0200 |
commit | cf05ade8f1a596e6a547b9d82c046d7da540baf7 (patch) | |
tree | 512731c2c0152f4c94776b9c23bf38c3d7e764a9 | |
parent | ff55cf8d5469f9923d2637a46641b68ba31145fd (diff) | |
download | ffmpeg-cf05ade8f1a596e6a547b9d82c046d7da540baf7.tar.gz |
avcodec/takdec: Fix integer overflows in decode_subframe()
Fixes: runtime error: signed integer overflow: -1562477869 + -691460395 cannot be represented in type 'int'
Fixes: 3196/clusterfuzz-testcase-minimized-4528307146063872
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 3dabb9c69db114b1f30c30e0a2788cffc50bac40)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/takdec.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c index 0fedc7864b..886ca8a27f 100644 --- a/libavcodec/takdec.c +++ b/libavcodec/takdec.c @@ -472,10 +472,10 @@ static int decode_subframe(TAKDecContext *s, int32_t *decoded, v += (unsigned)s->adsp.scalarproduct_int16(&s->residues[i], s->filter, filter_order & -16); for (j = filter_order & -16; j < filter_order; j += 4) { - v += s->residues[i + j + 3] * s->filter[j + 3] + - s->residues[i + j + 2] * s->filter[j + 2] + - s->residues[i + j + 1] * s->filter[j + 1] + - s->residues[i + j ] * s->filter[j ]; + v += s->residues[i + j + 3] * (unsigned)s->filter[j + 3] + + s->residues[i + j + 2] * (unsigned)s->filter[j + 2] + + s->residues[i + j + 1] * (unsigned)s->filter[j + 1] + + s->residues[i + j ] * (unsigned)s->filter[j ]; } v = (av_clip(v >> filter_quant, -8192, 8191) << dshift) - *decoded; *decoded++ = v; |