diff --git a/lib_com/options.h b/lib_com/options.h index e284d917ab6ee1d0f46a05dafb73fceaea7b3e8e..32cff6aa940080717a5f543c9d3c843c87333a42 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -188,6 +188,7 @@ #define NONBE_FIX_752_OSBA_MISCONFIG_MCT /* FhG: issue 752: misconfiguration of MCT causes crashes for coding with sampling rate under 48kHz at 256kbps*/ #define NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION /* Dlb : issue 727 : headrotation in MC paramupmix mode*/ +#define NONBE_FIX_722_MEMORY_LEAK_IN_PARAMUPMIX /* Dlb : issue 722: memory leak fix in MC param upmix mode with BR switching*/ #define NONBE_FIX_780_ISM_STARTS_WITH_SID /* VA: issue 780: fix Crash in ISM decoding when bitstream starts with an SID and output_config is not EXT */ #define NONBE_FIX_ISM_DTX_INFINITE_CNG_ON_TRAILING_SILENCE /* FhG: fix for cng in ISM DTX on sudden silence periods - JBM addon (issue 552) */ #define NONBE_FIX_738_SBA_BR_SW_ASAN /* FhG: issue 738: fixes bug when switching to an MCT bitrate and previous frame was ACELP */ diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index f6c32eae313623448a1d010495a39ad5c64275b9..425583a99af7bc73691dcfc68f99311bf1e4723b 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -951,10 +951,23 @@ static ivas_error ivas_mc_dec_reconfig( { ivas_mct_dec_close( &st_ivas->hMCT ); } +#ifndef NONBE_FIX_722_MEMORY_LEAK_IN_PARAMUPMIX + /* LFE handle */ + ivas_lfe_dec_close( &( st_ivas->hLFE ) ); +#endif + } +#ifdef NONBE_FIX_722_MEMORY_LEAK_IN_PARAMUPMIX + else if ( last_mc_mode == MC_MODE_PARAMUPMIX ) + { + ivas_mc_paramupmix_dec_close( &( st_ivas->hMCParamUpmix ) ); + } + if ( st_ivas->hLFE != NULL ) + { /* LFE handle */ ivas_lfe_dec_close( &( st_ivas->hLFE ) ); } +#endif } else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { @@ -990,10 +1003,19 @@ static ivas_error ivas_mc_dec_reconfig( if ( last_mc_mode == MC_MODE_MCT ) { ivas_mct_dec_close( &st_ivas->hMCT ); +#ifndef NONBE_FIX_722_MEMORY_LEAK_IN_PARAMUPMIX + /* LFE handle */ + ivas_lfe_dec_close( &( st_ivas->hLFE ) ); +#endif + } +#ifdef NONBE_FIX_722_MEMORY_LEAK_IN_PARAMUPMIX + if ( st_ivas->hLFE != NULL ) + { /* LFE handle */ ivas_lfe_dec_close( &( st_ivas->hLFE ) ); } +#endif } if ( st_ivas->mc_mode != MC_MODE_MCMASA )