Commit 3a2de87e authored by vaclav's avatar vaclav
Browse files

fix crash for for MASA 2TC "ivas_cod.exe -masa 2 stv_IVASMASA_1dir2TC_DTX.met...

fix crash for for MASA 2TC "ivas_cod.exe -masa 2 stv_IVASMASA_1dir2TC_DTX.met sw_13k2_512k.bin 48 stv_IVASMASA_1dir2TC_DTX.pcm bit"
parent 8cc9d0ca
Loading
Loading
Loading
Loading
Loading
+13 −10
Original line number Diff line number Diff line
@@ -898,12 +898,6 @@ ivas_error stereo_memory_dec(
                count_free( hCPE->hStereoTCA );
                hCPE->hStereoTCA = NULL;
            }

            if ( hCPE->hStereoICBWE != NULL )
            {
                count_free( hCPE->hStereoICBWE );
                hCPE->hStereoICBWE = NULL;
            }
#endif
        }
        else /* nchan_out == 2 */
@@ -945,12 +939,21 @@ ivas_error stereo_memory_dec(
                stereo_tca_init_dec( hCPE->hStereoTCA );
            }

            if ( hCPE->hStereoTCA != NULL && hCPE->element_mode == IVAS_CPE_MDCT )
            if ( hCPE->element_mode == IVAS_CPE_MDCT )
            {
                if( hCPE->hStereoTCA != NULL )
                {
                    /* note: in MASA, hCPE->hStereoMdct->itd = 0 */
                    count_free( hCPE->hStereoTCA );
                    hCPE->hStereoTCA = NULL;
                }

                if ( hCPE->hStereoICBWE != NULL )
                {
                    count_free( hCPE->hStereoICBWE );
                    hCPE->hStereoICBWE = NULL;
                }
            }
#endif
        }
    }