From 22544741ca0e519aea9b3ef63778cb2b5d0901c8 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 7 Aug 2024 12:44:56 +0530 Subject: [PATCH] [3GPP-Issue #824] Fixes crash in low level signal at 24.4 kbps with dtx enabled [x] The crash was occurring in function stereo_dft_generate_comfort_noise_fx(). The shr() in the IF condition overflow. Using shr_sat solved the issue --- lib_dec/ivas_stereo_cng_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_stereo_cng_dec.c b/lib_dec/ivas_stereo_cng_dec.c index 87b938c48..29664009e 100644 --- a/lib_dec/ivas_stereo_cng_dec.c +++ b/lib_dec/ivas_stereo_cng_dec.c @@ -1055,7 +1055,7 @@ static void stereo_dft_generate_comfort_noise_fx( tmp_16 = BASOP_Util_Divide3232_Scale( E0, E1, &q_div ); tmp_16 = Sqrt16( tmp_16, &q_div ); - IF( LT_16( tmp_16, shr( MAX_16, q_div ) ) ) + IF( LT_16( tmp_16, shr_sat( MAX_16, q_div ) ) ) { tmp_16 = shl( tmp_16, q_div ); hStereoCng->xfade_length = sub( MAX_XFADE_FX, extract_l( L_shr( imult3216( MAX_XFADE_FX, tmp_16 ), Q15 ) ) ); -- GitLab