From 166ef2565145cbb3b6d5dc22bf69cccd3435c8a3 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Fri, 24 Jan 2025 10:20:45 +0530 Subject: [PATCH 1/2] Fix for 3GPP issue 1188: Assertion error observed in evs_enc_fx (with option stereo_dmx_evs) from encode_magnitude_tcq_fx function Link #1188 --- lib_com/options.h | 1 + lib_com/tcq_position_arith_fx.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index f4c1a91f9..e58555dfe 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -126,4 +126,5 @@ #define FIX_ISSUE_1165 /* Ittiam: Fix for issue 1165: Assertion in lpc2lsp_fx for OMASA LTV input */ #define FIX_ISSUE_1185 /* Ittiam: Fix for issue 1185: Assertion in ivas_dirac_dec_binaural_internal_fx() for crash in decoder in fft30_with_cmplx_data()*/ #define FIX_ISSUE_1209 /* Ittiam: Fix for issue 1209: Assertion exit in BASOP encoder (stereo_dmx_evs)*/ +#define IVAS_ISSUE_1188_EVS_CRASH /* Ittiam: Fix for issue 1188: Issue due to ASAN */ #endif diff --git a/lib_com/tcq_position_arith_fx.c b/lib_com/tcq_position_arith_fx.c index 8d3f19718..467466f02 100644 --- a/lib_com/tcq_position_arith_fx.c +++ b/lib_com/tcq_position_arith_fx.c @@ -1983,7 +1983,11 @@ Word32 encode_magnitude_tcq_fx( move16(); bits_fx = L_deposit_l( 0 ); +#ifdef IVAS_ISSUE_1188_EVS_CRASH + tcq_bits_fx = L_sub( table_logcum_fx[npulses], L_add( table_logcum_fx[nzpos], table_logcum_fx[npulses - ( nzpos - 1 ) ] ) ); +#else tcq_bits_fx = L_sub( table_logcum_fx[npulses], L_add( table_logcum_fx[nzpos], table_logcum_fx[npulses - nzpos - 1] ) ); +#endif *est_frame_bits_fx = L_add( *est_frame_bits_fx, tcq_bits_fx ); move32(); -- GitLab From 11f6cf5e718b6457da4dac12e0bbbd1adda84d8d Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Fri, 24 Jan 2025 12:16:00 +0530 Subject: [PATCH 2/2] Similar changes at other location --- lib_com/tcq_position_arith_fx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib_com/tcq_position_arith_fx.c b/lib_com/tcq_position_arith_fx.c index 467466f02..0466dc133 100644 --- a/lib_com/tcq_position_arith_fx.c +++ b/lib_com/tcq_position_arith_fx.c @@ -1984,7 +1984,7 @@ Word32 encode_magnitude_tcq_fx( bits_fx = L_deposit_l( 0 ); #ifdef IVAS_ISSUE_1188_EVS_CRASH - tcq_bits_fx = L_sub( table_logcum_fx[npulses], L_add( table_logcum_fx[nzpos], table_logcum_fx[npulses - ( nzpos - 1 ) ] ) ); + tcq_bits_fx = L_sub( table_logcum_fx[npulses], L_add( table_logcum_fx[nzpos], table_logcum_fx[npulses - ( nzpos - 1 )] ) ); #else tcq_bits_fx = L_sub( table_logcum_fx[npulses], L_add( table_logcum_fx[nzpos], table_logcum_fx[npulses - nzpos - 1] ) ); #endif @@ -2470,7 +2470,11 @@ void decode_mangitude_tcq_fx( move16(); bits_fx = L_deposit_l( 0 ); +#ifdef IVAS_ISSUE_1188_EVS_CRASH + tcq_bits_fx = L_sub( table_logcum_fx[npulses], L_add( table_logcum_fx[nzpos], table_logcum_fx[npulses - ( nzpos - 1 )] ) ); +#else tcq_bits_fx = L_sub( table_logcum_fx[npulses], L_add( table_logcum_fx[nzpos], table_logcum_fx[npulses - nzpos - 1] ) ); +#endif IF( EQ_16( nzpos, npulses ) ) { -- GitLab