diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-03-28 00:12:17 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-04-04 00:05:36 +0200 |
commit | 89374decf6fa411f3b3414e791613bf11a8a39cc (patch) | |
tree | 3ca50afda1ce03d288e80cfa4ac13cea1b25c0ce | |
parent | 30107735083f6bbc08a10fc0441b3cf3213e0827 (diff) | |
download | ffmpeg-89374decf6fa411f3b3414e791613bf11a8a39cc.tar.gz |
avcodec/apedec: fix a integer overflow in long_filter_high_3800()
Fixes: signed integer overflow: -2146549696 - 3923884 cannot be represented in type 'int'
Fixes: 45907/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5992380584558592
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 b085b400becb93ccc68d786ab738b1fc50408b89)
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 607304fe36..8e56b96726 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -955,7 +955,7 @@ static void long_filter_high_3800(int32_t *buffer, int order, int shift, int len dotprod += delay[j] * (unsigned)coeffs[j]; coeffs[j] += ((delay[j] >> 31) | 1) * sign; } - buffer[i] -= dotprod >> shift; + buffer[i] -= (unsigned)(dotprod >> shift); for (j = 0; j < order - 1; j++) delay[j] = delay[j + 1]; delay[order - 1] = buffer[i]; |