From d92a8c6ab51eeeeedca45b7f7a395949624e66c1 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Tue, 5 Nov 2024 12:25:05 +0530 Subject: [PATCH] Fix for 3GPP issue 997: Decoder crashed when decoding an OSBA bitstream --- lib_com/ivas_filters.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib_com/ivas_filters.c b/lib_com/ivas_filters.c index 425149fe0..0ef0960d7 100644 --- a/lib_com/ivas_filters.c +++ b/lib_com/ivas_filters.c @@ -354,6 +354,14 @@ static void ivas_iir_2_filter_fx( filter_state->state_fx[stage][j - 1] = BASOP_Util_Add_Mant32Exp( L_tmp, L_tmp_e, L_negate( L_tmp_prod ), L_prod_e, &filter_state->state_e[stage][j - 1] ); // Q31 - filter_state->state_e[stage][j - 1] move32(); + /*In case when exponent is less than -31 the value is very small and negligible hence resetting it to zero to avoid exponent overflow*/ + IF( LT_16( filter_state->state_e[stage][j - 1], -31 ) ) + { + filter_state->state_fx[stage][j - 1] = 0; + move32(); + filter_state->state_e[stage][j - 1] = 0; + move16(); + } } } } -- GitLab