diff --git a/lib_com/basop_util.c b/lib_com/basop_util.c index e52f404f6f83b00535931530c021d8e381dd072f..3d6324783201b56b9dcc849ceab2b8dd2ee0b6c3 100644 --- a/lib_com/basop_util.c +++ b/lib_com/basop_util.c @@ -1409,7 +1409,11 @@ Word32 BASOP_Util_Divide3232_Scale_newton( Word32 x, Word32 y, Word16 *s ) *s = 0; return ( (Word32) 0 ); } +#ifdef FIX_USAN_BASOP_UTIL_DIVIDE3232 + IF( EQ_32( y, (Word32) 0x80000000 ) ) +#else IF( EQ_32( y, 0x80000000 ) ) +#endif { /* Division by -1.0: same as negation of numerator */ /* Return normalized negated numerator */ diff --git a/lib_com/options.h b/lib_com/options.h index a5d5a4846c8ca6a0005aa7ef7bd9e2c4e3582dbd..fe44eae00614ba56864934dfcabaded9db421921 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -105,5 +105,6 @@ #define REMOVE_EVS_DUPLICATES /* remove core-coder duplicated functions, ACELP low-band decoder */ #define FIX_1713_EXP /* VA: proposed correction to exp in ic-BWE*/ +#define FIX_USAN_BASOP_UTIL_DIVIDE3232 /* Eri: Fix USAN error in BASOP_Util_Divide3232_Scale_newton by adding explicit type cast for -1 in hex */ #endif