Commit dc3f327e authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/apedec: Fixes integer overflow of res+*data in do_apply_filter()

Fixes: signed integer overflow: 7400 + 2147482786 cannot be represented in type 'int'
Fixes: 18405/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5708834760294400

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent b6abdb1f
......@@ -1272,7 +1272,7 @@ static void do_apply_filter(APEContext *ctx, int version, APEFilter *f,
f->adaptcoeffs - order,
order, APESIGN(*data));
res = (int)(res + (1U << (fracbits - 1))) >> fracbits;
res += *data;
res += (unsigned)*data;
*data++ = res;
/* Update the output history */
......
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