Commit c4af42e6 authored by wkr's avatar wkr
Browse files

preliminarily fix memory leak in osba-to-stereo bitrate switching

parent 0b80149e
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -159,6 +159,15 @@ ivas_error ivas_corecoder_dec_reconfig(
            st_ivas->hSCE[sce_id] = NULL;
        }

#ifdef JBM_FOR_OSBA
        if ( sba_dirac_stereo_flag_old && nCPE_old == 0 && st_ivas->hCPE[0] )
        {
            st_ivas->hCPE[0]->hCoreCoder[0] = 0; /* this has been deallocated as part of the SCE it actually belongs to */
            destroy_cpe_dec( st_ivas->hCPE[0] );
            st_ivas->hCPE[0] = NULL;
        }
#endif

        for ( cpe_id = st_ivas->nCPE; cpe_id < nCPE_old; cpe_id++ )
        {
            /* don't deallocate first CPE in case of mono/stereo output of 1 TC SBA, only deallocate core coder */