Commit 210e2033 authored by multrus's avatar multrus
Browse files

ivas_destroy_dec(): remove dependency on format, to avoid a memory leak in...

ivas_destroy_dec(): remove dependency on format, to avoid a memory leak in case of format switching; see float issue 1526 for details
parent ac900052
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@
#define HARM_FD_BWE                                     /* VA: harmonize core-coder FD BWE function duplications */
#define FIX_2411_Harmonize_TNSANALYSIS_DETECTTNSFILT    /* FhG: basop issue 2411: harmonize TNSAnalysis*_fx(), DetectTnsFilt*_fx()*/        
#define HARMONIZE_READ_DECODE_TNS                       /* FhG basop 2389: Harm between two pairs of functions. */
#define FIX_FLOAT_1526_DIRAC_MEM_LEAK                   /* FhG: float issue 1526: potential memory leak in DirAC handles in case of format switching */

/* #################### End BE switches ################################## */

+10 −0
Original line number Diff line number Diff line
@@ -3445,6 +3445,15 @@ void ivas_destroy_dec_fx(
    /* ISM renderer handle */
    ivas_ism_renderer_close( &( st_ivas->hIsmRendererData ) );

#ifdef FIX_FLOAT_1526_DIRAC_MEM_LEAK
    /* ParamISM dec handle */
    ivas_param_ism_dec_close_fx( &( st_ivas->hParamIsmDec ), &( st_ivas->hSpatParamRendCom ), st_ivas->hDecoderConfig->output_config );

    /* DirAC handles */
    ivas_dirac_rend_close_fx( &( st_ivas->hDirACRend ) );
    ivas_spat_hSpatParamRendCom_close_fx( &( st_ivas->hSpatParamRendCom ) );
    ivas_dirac_dec_close_fx( &( st_ivas->hDirAC ) );
#else
    /* DirAC handle */
    IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) )
    {
@@ -3456,6 +3465,7 @@ void ivas_destroy_dec_fx(
        ivas_spat_hSpatParamRendCom_close_fx( &( st_ivas->hSpatParamRendCom ) );
        ivas_dirac_dec_close_fx( &( st_ivas->hDirAC ) );
    }
#endif

    /* SPAR handle */
    ivas_spar_dec_close_fx( &( st_ivas->hSpar ), st_ivas->hDecoderConfig->output_Fs, 0 );