[FFmpeg-cvslog] avcodec/wavarc: fix integer overflow in decode_5elp() block type 2

Michael Niedermayer git at videolan.org
Wed May 22 23:15:31 EEST 2024


ffmpeg | branch: release/7.0 | Michael Niedermayer <michael at niedermayer.cc> | Fri Apr 26 05:08:38 2024 +0200| [0047b51b8dc10e0ea14eaaf767a566e38a56ba99] | committer: Michael Niedermayer

avcodec/wavarc: fix integer overflow in decode_5elp() block type 2

Fixes: signed integer overflow: 2097152000 + 107142979 cannot be represented in type 'int'
Fixes: 67919/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-5955101769400320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit a2ec2bd49317ab16a3c30c0824efc580ea9a8aef)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/wavarc.c b/libavcodec/wavarc.c
index e121f1bc61..536c74e478 100644
--- a/libavcodec/wavarc.c
+++ b/libavcodec/wavarc.c
@@ -690,7 +690,7 @@ static int decode_5elp(AVCodecContext *avctx,
                 for (int o = 0; o < order; o++)
                     sum += s->filter[ch][o] * (unsigned)samples[n + 70 - o - 1];
 
-                samples[n + 70] += ac_out[n] + (sum >> 4);
+                samples[n + 70] += ac_out[n] + (unsigned)(sum >> 4);
             }
 
             for (int n = 0; n < 70; n++)



More information about the ffmpeg-cvslog mailing list