From 27be50e0717a2dd3fbbdbca5df22de11f372db5f Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Fri, 16 Jan 2026 11:02:10 +0200 Subject: [PATCH 1/2] Fix basop issue 2332 and similar cases by using precomputed sizes correctly. --- lib_com/options.h | 1 + lib_rend/lib_rend_fx.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index a884d61ec..5bffa59ff 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -100,6 +100,7 @@ #define OPT_BE_2311_HARM_GSC_GAIN /* VA: issue 2311: BE part of the GSC gain harmonization pipeline #70380 shows the BE */ #define HARM_CORECODER_UPDT /* VA: basop issue 2342: Remove duplicated code in core-coder common update functions */ #define HARM_CORE_SW /* VA: basop issue 2314: Remove duplicated code in the core switching */ +#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 101015fd0..2435e6a7d 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -11132,7 +11132,11 @@ 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(); @@ -11149,7 +11153,11 @@ static void intermidiate_ext_dirac_render( 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(); @@ -11171,7 +11179,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(); -- GitLab From e4f5568388519865dfc7e41924cd88871da438b7 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Fri, 16 Jan 2026 11:09:48 +0200 Subject: [PATCH 2/2] Remove unnecessary code. --- lib_rend/lib_rend_fx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 2435e6a7d..5fac50a8e 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -11142,6 +11142,7 @@ static void intermidiate_ext_dirac_render( move16(); } +#ifndef FIX_BASOP_2332_ASAN_OVERFLOW_IN_EXT_DIRAC_REND Word16 num_channels_dir = hDirACRend->num_outputs_dir; move16(); @@ -11150,7 +11151,7 @@ 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 -- GitLab