Commit ff0aca81 authored by norvell's avatar norvell
Browse files

Merge branch...

Merge branch '462-use-of-uninitialized-memory-in-external-hrtf-deallocation-in-decoder-together-with-br-switching' into 'main'

Added fix FIX_462_HRTF_FILE_BR_SWITCH_MEM_ERR to do proper deallocation

See merge request !662
parents 4202009a 458c9a78
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -157,6 +157,7 @@
#define FIX_MDCT_ST_PLC_FADEOUT_DELAY
#define FIX_DIRAC_LS_SYNTHESIS_CONFIG_479               /* FhG: fix for issue 479, broken LS output with DirAC at high BRs */
#define HYBRID_ITD_MAX                                 /* FhG: Improvement for DFT-stereo for cases with large ITDs */
#define FIX_462_HRTF_FILE_BR_SWITCH_MEM_ERR             /* Eri: Fix for issue 462: Use-of-uninitialized memory in external HRTF deallocation in decoder together with BR switching */
#define FIX_487_LOWRATE_SBA_TUNING_FIX                  /* Dlb: TUning fix for low bitrate cases to match theoretical longest SPAR MD bitstream */
#define FIX_490_MASA_2TC_LBR_DTX                        /* Nokia: Fixes issue 490 by correcting condition. */

+25 −1
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@
#endif
#include "wmc_auto.h"


/*-------------------------------------------------------------------------*
 * ivas_ism_bitrate_switching()
 *
@@ -186,11 +185,21 @@ static ivas_error ivas_ism_bitrate_switching(
            ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin );

            /* Open the TD Binaural renderer */
#ifdef FIX_462_HRTF_FILE_BR_SWITCH_MEM_ERR
            if ( st_ivas->hHrtfTD == NULL || st_ivas->hBinRendererTd == NULL )
            {
                if ( ( error = ivas_td_binaural_open( st_ivas ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
            }
#else
            if ( ( error = ivas_td_binaural_open( st_ivas ) ) != IVAS_ERR_OK )
            {
                return error;
            }
#endif
        }
        else
        {
            /* close the ISM renderer and reinitialize */
@@ -252,6 +261,20 @@ static ivas_error ivas_ism_bitrate_switching(
            }

            /* Close the TD Binaural renderer */
#ifdef FIX_462_HRTF_FILE_BR_SWITCH_MEM_ERR
            if ( st_ivas->hBinRendererTd->HrFiltSet_p->ModelParams.modelROM == TRUE )
            {
                if ( st_ivas->hBinRendererTd != NULL )
                {
                    ivas_td_binaural_close( &st_ivas->hBinRendererTd );
                }

                if ( st_ivas->hHrtfTD != NULL )
                {
                    st_ivas->hHrtfTD = NULL;
                }
            }
#else
            if ( st_ivas->hBinRendererTd != NULL )
            {
                ivas_td_binaural_close( &st_ivas->hBinRendererTd );
@@ -261,6 +284,7 @@ static ivas_error ivas_ism_bitrate_switching(
            {
                st_ivas->hHrtfTD = NULL;
            }
#endif
        }
        else
        {