diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-09-02 23:44:50 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-09-05 20:45:53 +0300 |
commit | 9d3ddef519e88c40c05be8cb94cd9e71c0957ec7 (patch) | |
tree | 6ef2843effcf6e089ab64c13320b0de1cc0e9367 /libavcodec/apedec.c | |
parent | 43b3412631893ca432857304e91d85b953bd5feb (diff) |
avcodec/apedec: Fix 32bit int overflow in do_apply_filter()
Fixes: signed integer overflow: 2147480546 + 4096 cannot be represented in type 'int'
Fixes: 16280/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5123442566758400
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/apedec.c')
-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 490b11b94e..ed22f0f019 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -1266,7 +1266,7 @@ static void do_apply_filter(APEContext *ctx, int version, APEFilter *f, f->delay - order, f->adaptcoeffs - order, order, APESIGN(*data)); - res = (res + (1 << (fracbits - 1))) >> fracbits; + res = (int)(res + (1U << (fracbits - 1))) >> fracbits; res += *data; *data++ = res; |