Commit 130166fc 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 efe53129
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -162,6 +162,7 @@
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define FIX_FLOAT_1522_LTV_MSAN_QMETADATA_ENC_EC3       /* Nokia: float issue 1522: fix uninit MSAN in EC3 of qmetadata encoding */
#define FIX_FLOAT_1526_DIRAC_MEM_LEAK                   /* FhG: potential memory leak in DirAC handles in case of format switching */

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

+10 −0
Original line number Diff line number Diff line
@@ -2884,6 +2884,15 @@ void ivas_destroy_dec(
    /* 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( &( st_ivas->hParamIsmDec ), &( st_ivas->hSpatParamRendCom ), st_ivas->hDecoderConfig->output_config );

    /* DirAC handles */
    ivas_dirac_rend_close( &( st_ivas->hDirACRend ) );
    ivas_spat_hSpatParamRendCom_close( &( st_ivas->hSpatParamRendCom ) );
    ivas_dirac_dec_close( &( st_ivas->hDirAC ) );
#else
    /* DirAC handle */
    if ( st_ivas->ivas_format == ISM_FORMAT )
    {
@@ -2895,6 +2904,7 @@ void ivas_destroy_dec(
        ivas_spat_hSpatParamRendCom_close( &( st_ivas->hSpatParamRendCom ) );
        ivas_dirac_dec_close( &( st_ivas->hDirAC ) );
    }
#endif

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