aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-03-26 21:34:03 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2023-05-26 00:04:41 +0200
commit477c5cf0236e1d8c0bbd6fcb1833198c306168b7 (patch)
tree6e419bbf076beb1023918a98c74a0178f630bdc0 /libavcodec
parent70189b9ecb28faf05cc40b98c131546631807707 (diff)
downloadffmpeg-477c5cf0236e1d8c0bbd6fcb1833198c306168b7.tar.gz
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@niedermayer.cc> (cherry picked from commit 6d1d8609ac1054017ea3d11b325ed94a1205e9fd) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/g729postfilter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/g729postfilter.c b/libavcodec/g729postfilter.c
index 617744ec8e..668177c843 100644
--- a/libavcodec/g729postfilter.c
+++ b/libavcodec/g729postfilter.c
@@ -350,7 +350,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) {