diff --git a/lib_com/options.h b/lib_com/options.h index 8ede9e10c113e8f8a17e80ad72722ea365133aa9..fa1e49d4913db3113f193b4cc3a543562f1a8a0e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -113,6 +113,7 @@ #define FIX_BASOP_2327_WRONG_LOOP_END /* Nokia: basop inssue 2327: Correct loop end to solve MSAN error */ #define FIX_BASOP_2328_MSAN_WRONG_ASSIGNMENT /* Nokia: basop issue 2328: Fix MSAN error by correcting the variable assignment */ #define FIX_BASOP_2329_UNINIT_VALUE /* Nokia: basop issue 2329: Fix issue by checking for structure instead of length */ +#define FIX_BASOP_2332_ASAN_OVERFLOW_IN_EXT_DIRAC_REND /* Nokia: basop issue 2332: Uses predefined memory sizes instead computing wrong */ /* #################### End BE switches ################################## */ diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 168e33f7467e8529e6f7efba7190d06defffd03b..5d5179c536ffed5770b4e858d5190cfadf182cf0 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -11153,12 +11153,17 @@ static void intermidiate_ext_dirac_render( IF( hDirACRend->h_output_synthesis_psd_state.cy_auto_dir_smooth_fx ) { +#ifdef FIX_BASOP_2332_ASAN_OVERFLOW_IN_EXT_DIRAC_REND + Word16 shift = L_norm_arr( hDirACRend->h_output_synthesis_psd_state.cy_auto_dir_smooth_fx, hDirACRend->h_output_synthesis_psd_state.cy_auto_dir_smooth_len ); +#else Word16 shift = L_norm_arr( hDirACRend->h_output_synthesis_psd_state.cy_auto_dir_smooth_fx, imult1616( hDirACRend->num_outputs_dir, hSpatParamRendCom->num_freq_bands ) ); +#endif scale_sig32( hDirACRend->h_output_synthesis_psd_state.cy_auto_dir_smooth_fx, hDirACRend->h_output_synthesis_psd_state.cy_auto_dir_smooth_len, shift ); /* Q(hDirACRend->h_output_synthesis_psd_state.q_cy_auto_dir_smooth + shift) */ hDirACRend->h_output_synthesis_psd_state.q_cy_auto_dir_smooth = add( hDirACRend->h_output_synthesis_psd_state.q_cy_auto_dir_smooth, shift ); move16(); } +#ifndef FIX_BASOP_2332_ASAN_OVERFLOW_IN_EXT_DIRAC_REND Word16 num_channels_dir = hDirACRend->num_outputs_dir; move16(); @@ -11167,10 +11172,14 @@ static void intermidiate_ext_dirac_render( num_channels_dir = hDirACRend->hOutSetup.nchan_out_woLFE; move16(); } - +#endif IF( h_dirac_output_synthesis_state->cy_auto_diff_smooth_fx ) { +#ifdef FIX_BASOP_2332_ASAN_OVERFLOW_IN_EXT_DIRAC_REND + tmp = L_norm_arr( h_dirac_output_synthesis_state->cy_auto_diff_smooth_fx, hDirACRend->h_output_synthesis_psd_state.cy_auto_diff_smooth_len ); +#else tmp = L_norm_arr( h_dirac_output_synthesis_state->cy_auto_diff_smooth_fx, imult1616( num_channels_dir, hSpatParamRendCom->num_freq_bands ) ); +#endif scale_sig32( h_dirac_output_synthesis_state->cy_auto_diff_smooth_fx, hDirACRend->h_output_synthesis_psd_state.cy_auto_diff_smooth_len, tmp ); /* Q(h_dirac_output_synthesis_state->q_cy_auto_diff_smooth + tmp) */ h_dirac_output_synthesis_state->q_cy_auto_diff_smooth = add( h_dirac_output_synthesis_state->q_cy_auto_diff_smooth, tmp ); move16(); @@ -11192,7 +11201,11 @@ static void intermidiate_ext_dirac_render( move16(); IF( hDirACRend->h_output_synthesis_psd_state.cy_auto_dir_smooth_prev_fx ) { +#ifdef FIX_BASOP_2332_ASAN_OVERFLOW_IN_EXT_DIRAC_REND + Word16 shift = L_norm_arr( hDirACRend->h_output_synthesis_psd_state.cy_auto_dir_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.cy_auto_dir_smooth_prev_len ); +#else Word16 shift = L_norm_arr( hDirACRend->h_output_synthesis_psd_state.cy_auto_dir_smooth_prev_fx, imult1616( hSpatParamRendCom->num_freq_bands, hDirACRend->num_outputs_dir ) ); +#endif scale_sig32( hDirACRend->h_output_synthesis_psd_state.cy_auto_dir_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.cy_auto_dir_smooth_prev_len, shift ); /* Q(hDirACRend->h_output_synthesis_psd_state.q_cy_auto_dir_smooth_prev + shift) */ hDirACRend->h_output_synthesis_psd_state.q_cy_auto_dir_smooth_prev = add( hDirACRend->h_output_synthesis_psd_state.q_cy_auto_dir_smooth_prev, shift ); move16();