diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-10-29 18:30:07 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-01-06 11:30:44 +0100 |
commit | 1baae1c8f1f2e54960b10b83f659cceb010c6639 (patch) | |
tree | 1b3b9c6bd87372d43dddecdb780a56e94abe2f9c | |
parent | 6778b3c9275bdbe73774230ee7f8e584b8c6c30f (diff) | |
download | ffmpeg-1baae1c8f1f2e54960b10b83f659cceb010c6639.tar.gz |
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/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit dc3f327e7403a34c88a900f0b8de55b4afd7cf6c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/apedec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index 0c0c22b18a..7d07f5f8f1 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -1268,7 +1268,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 */ |