Commit 6274709c authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/takdec: Fix integer overflow in decode_subframe()

Fixes: runtime error: signed integer overflow: -536870912 - 1972191120 cannot be represented in type 'int'
Fixes: 2711/clusterfuzz-testcase-minimized-4975142398590976

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2c630d15)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 06ce68d8
...@@ -489,7 +489,7 @@ static int decode_subframe(TAKDecContext *s, int32_t *decoded, ...@@ -489,7 +489,7 @@ static int decode_subframe(TAKDecContext *s, int32_t *decoded,
s->residues[i + j + 1] * s->filter[j + 1] + s->residues[i + j + 1] * s->filter[j + 1] +
s->residues[i + j ] * s->filter[j ]; s->residues[i + j ] * s->filter[j ];
} }
v = (av_clip_intp2(v >> filter_quant, 13) * (1 << dshift)) - *decoded; v = (av_clip_intp2(v >> filter_quant, 13) * (1 << dshift)) - (unsigned)*decoded;
*decoded++ = v; *decoded++ = v;
s->residues[filter_order + i] = v >> dshift; s->residues[filter_order + i] = v >> dshift;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment