[FFmpeg-cvslog] avcodec/g729postfilter: Limit shift in long term filter

Michael Niedermayer git at videolan.org
Thu Oct 19 14:31:11 EEST 2023


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Sun Mar 26 21:34:03 2023 +0200| [26e78a28f93d8e8aabf88d38f042c594fe670f53] | committer: Michael Niedermayer

avcodec/g729postfilter: Limit shift in long term filter

Fixes: shift exponent 34 is too large for 32-bit type 'int'
Fixes: 57389/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ACELP_KELVIN_fuzzer-6229522659016704

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 6d1d8609ac1054017ea3d11b325ed94a1205e9fd)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/g729postfilter.c b/libavcodec/g729postfilter.c
index 1167e09147..82476f2872 100644
--- a/libavcodec/g729postfilter.c
+++ b/libavcodec/g729postfilter.c
@@ -347,7 +347,7 @@ static int16_t long_term_filter(AudioDSPContext *adsp, int pitch_delay_int,
         if (tmp > 0)
             L_temp0 >>= tmp;
         else
-            L_temp1 >>= -tmp;
+            L_temp1 >>= FFMIN(-tmp, 31);
 
         /* Check if longer filter increases the values of R'(k). */
         if (L_temp1 > L_temp0) {



More information about the ffmpeg-cvslog mailing list