aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/apedec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-29 18:30:07 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-21 23:41:47 +0100
commit6b430f066b9d6637f145fe228e7950a03820a1ab (patch)
tree26329e995d3daa30733f90d202d30d59517a4fa0 /libavcodec/apedec.c
parent17d5c21b3d1249672323bd1ab09718e29ce77e91 (diff)
downloadffmpeg-6b430f066b9d6637f145fe228e7950a03820a1ab.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>
Diffstat (limited to 'libavcodec/apedec.c')
-rw-r--r--libavcodec/apedec.c2
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 */