From 361e8c5a62a47569ba7f61dbaaa51f01a04b267d Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 14 May 2025 08:53:17 +0530 Subject: [PATCH] Fix for 3GPP issue 1375: Underflow observed in the quantize_pars_fx() function in the MC param upmix Link #1375 --- lib_com/basop_util.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib_com/basop_util.c b/lib_com/basop_util.c index dc9013a42..e52f404f6 100644 --- a/lib_com/basop_util.c +++ b/lib_com/basop_util.c @@ -2640,10 +2640,16 @@ Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ */ if ( !a_m ) - a_e = add( b_e, 0 ); + { + a_e = b_e; + move16(); + } if ( !b_m ) - b_e = add( a_e, 0 ); + { + b_e = a_e; + move16(); + } shift = sub( a_e, b_e ); shift = s_max( -31, shift ); @@ -2664,7 +2670,10 @@ Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ if ( shift ) L_tmp = L_shl( L_tmp, shift ); if ( L_tmp == 0 ) - a_e = add( 0, 0 ); + { + a_e = 0; + move16(); + } if ( L_tmp != 0 ) a_e = sub( a_e, shift ); *ptr_e = a_e; -- GitLab