[FFmpeg-cvslog] avcodec/apedec: fix a integer overflow in long_filter_high_3800()

Michael Niedermayer git at videolan.org
Mon Apr 4 00:53:42 EEST 2022


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Mar 28 00:12:17 2022 +0200| [b085b400becb93ccc68d786ab738b1fc50408b89] | committer: Michael Niedermayer

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 at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b085b400becb93ccc68d786ab738b1fc50408b89
---

 libavcodec/apedec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index f7f8a88994..65e5d152e0 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -959,7 +959,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];



More information about the ffmpeg-cvslog mailing list