Commit 27be50e0 authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Fix basop issue 2332 and similar cases by using precomputed sizes correctly.

parent 2997f3e6
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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 ################################## */

+12 −0
Original line number Diff line number Diff line
@@ -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();