Commit da859053 authored by PLAINSI's avatar PLAINSI
Browse files

Merge branch '722-memory-leak-in-mc-paramupmix-with-bitrate-switching' into 'main'

[non-BE] fix #722 memory leak for paramupmix when switching mc bitrates

See merge request !1010
parents e579181d 5d1bfe16
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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 */
+22 −0
Original line number Diff line number Diff line
@@ -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 )