Commit 90f7f3e5 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

ASAN and USAN fixes

parent 4e93fd5c
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -72,6 +72,11 @@

#define NON_BE_FIX_1048_THRESHOLD_COH_BASOP             /* Nokia: Fix 1048 replace comparison with 0 with comparison to threshold, to align with BASOP*/
#define NONBE_FIX_1054_NEGATIVE_LVQ_INDEX               /* Nokia: issue 1054: Input to decode_comb in deindex_lvq_SHB should be positive */
#define FIX_1033_MEMORY_LEAK_OMASA                      /* Nokia / Orange: issue #1033: Memory leak in OMASA to BINAURAL with HRTF with bitrate switching */
#define FIX_976_USAN_PVQ_ENC_DEC_EVS_CR                 /* Ericsson:  premature cast to unsigned detected by USAN corrected  */
#define FIX_1027_GSC_INT_OVERFLOW                       /* VA: issue 2207: overflow in GSC */
#define NONBE_FIX_1096_NAN_VALUES_IN_DIRAC_TO_STEREO    /* FhG: avoid sidegain DFT-Stereo param to be larger than 1 when converting from Dirac parameters */
#define NON_BE_1055_RESET_LP_MEMORIES                   /* VA: issue 1055: Correctly reset LP filter MA and AR memories in bitrate switching */

/* #################### End FIXES switches ############################ */

+1 −1
Original line number Diff line number Diff line
@@ -763,7 +763,7 @@ ivas_error amr_wb_dec_fx(
        st_fx->hPFstat->on = 1;
        move16();
        test();
        formant_post_filt_fx( st_fx->hPFstat, tmp_buffer_fx + L_SYN_MEM, Aq_fx, syn_fx, L_FRAME, L_shl( st_fx->psf_lp_noise_fx, 15 ), st_fx->total_brate, EQ_16( sub( amr_io_class, AUDIO_CLAS ), 0 ) );
        formant_post_filt_fx( st_fx->hPFstat, tmp_buffer_fx + L_SYN_MEM, Aq_fx, syn_fx, L_FRAME, L_shl( st_fx->psf_lp_noise_fx, 15 ), st_fx->total_brate, (Word16)EQ_16( sub( amr_io_class, AUDIO_CLAS ), 0 ) );
    }

    /*----------------------------------------------------------------*
+4 −0
Original line number Diff line number Diff line
@@ -639,7 +639,11 @@ void gsc_dec(
                }
                if ( concat_out[j] < 0 )
                {
#ifdef FIX_1027_GSC_INT_OVERFLOW
                    seed_init = (int16_t) ( (int32_t) seed_init + 3 );
#else
                    seed_init += 3;
#endif
                }
            }

+14 −0
Original line number Diff line number Diff line
@@ -1920,8 +1920,15 @@ static ivas_error ivas_mc_dec_reconfig_fx(

            IF( st_ivas->hBinRendererTd != NULL && ( NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) ) )
            {
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                if ( st_ivas->hBinRendererTd->HrFiltSet_p->ModelParams.modelROM == TRUE )
                {
#endif
                ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd );
                st_ivas->hHrtfTD = NULL;
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                }
#endif
            }

            IF( st_ivas->hDiracDecBin != NULL )
@@ -2548,8 +2555,15 @@ static ivas_error ivas_mc_dec_reconfig(

            if ( st_ivas->hBinRendererTd != NULL && ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD ) )
            {
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                if ( st_ivas->hBinRendererTd->HrFiltSet_p->ModelParams.modelROM == TRUE )
                {
#endif
                ivas_td_binaural_close( &st_ivas->hBinRendererTd );
                st_ivas->hHrtfTD = NULL;
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                }
#endif
            }

            if ( st_ivas->hDiracDecBin != NULL )
+29 −1
Original line number Diff line number Diff line
@@ -457,10 +457,17 @@ ivas_error ivas_omasa_dec_config_fx(
            IF( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) )
            {
                /* Allocate TD renderer for the objects in DISC mode */
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                IF ( st_ivas->hBinRendererTd == NULL )
                {
#endif
                IF ( ( error = ivas_td_binaural_open_fx( st_ivas, SrcInd, num_src ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                }
#endif

                /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */
                IF( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK )
@@ -471,9 +478,16 @@ ivas_error ivas_omasa_dec_config_fx(
            ELSE
            {
                /* TD renderer handle */
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                IF ( st_ivas->hBinRendererTd != NULL && st_ivas->hBinRendererTd->HrFiltSet_p->ModelParams.modelROM == TRUE )
                {
#endif
                ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd );

                st_ivas->hHrtfTD = NULL;
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                }
#endif

                /* ISM renderer handle + ISM data handle */
                ivas_omasa_separate_object_renderer_close( st_ivas );
@@ -707,11 +721,18 @@ ivas_error ivas_omasa_dec_config(
        {
            if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC )
            {
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                if ( st_ivas->hBinRendererTd == NULL )
                {
#endif
                /* Allocate TD renderer for the objects in DISC mode */
                if ( ( error = ivas_td_binaural_open( st_ivas ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                }
#endif

                /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */
                if ( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK )
@@ -722,8 +743,15 @@ ivas_error ivas_omasa_dec_config(
            else
            {
                /* TD renderer handle */
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                if ( st_ivas->hBinRendererTd != NULL && st_ivas->hBinRendererTd->HrFiltSet_p->ModelParams.modelROM == TRUE )
                {
#endif
                ivas_td_binaural_close( &st_ivas->hBinRendererTd );
                st_ivas->hHrtfTD = NULL;
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                }
#endif

                /* ISM renderer handle + ISM data handle */
                ivas_omasa_separate_object_renderer_close( st_ivas );
Loading