Commit 97da24f3 authored by Jouni Paulus's avatar Jouni Paulus
Browse files

Merge branch 'asan_error_omasa_to_binaural_with_hrtf_load_and_bitrate_switching' into 'main'

[non-be] Resolve #1033: Memory leak in OMASA to BINAURAL with HRTF with bitrate switching

See merge request !1462
parents fce2db0e 8bf8e689
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -159,6 +159,7 @@
#define FIX_1024_REMOVE_PARAMMC_MIXING_MAT              /* VA: issue 1024: remove unused function ivas_param_mc_get_mono_stereo_mixing_matrices() */
#define FIX_1023_REMOVE_PARAMMC_DEC                     /* VA: issue 1023: remove unused function ivas_param_mc_dec() */
#define FIX_1022_REMOVE_PARAMISM_DEC                    /* VA: issue 1022: remove unused function ivas_param_ism_dec() */
#define FIX_1033_MEMORY_LEAK_OMASA                      /* Nokia / Orange: issue #1033: Memory leak in OMASA to BINAURAL with HRTF with bitrate switching */

#define FIX_1035_HT_OSBA                                /* Dlb: issue 1035: Issue with headtracking in OSBA*/
/* #################### End BE switches ################################## */
+9 −2
Original line number Diff line number Diff line
@@ -1210,8 +1210,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
            }

#ifdef SPLIT_REND_WITH_HEAD_ROT
+19 −7
Original line number Diff line number Diff line
@@ -378,11 +378,17 @@ ivas_error ivas_omasa_dec_config(
            if ( 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( 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 )
                {
@@ -391,10 +397,16 @@ ivas_error ivas_omasa_dec_config(
            }
            else
            {
#ifdef FIX_1033_MEMORY_LEAK_OMASA
                if ( st_ivas->hBinRendererTd != NULL && st_ivas->hBinRendererTd->HrFiltSet_p->ModelParams.modelROM == TRUE )
                {
#endif
                    /* TD renderer handle */
                    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 );
            }