Commit 5b9f47d0 authored by norvell's avatar norvell
Browse files

Added fix for memory deallocation issue under FIX_235

parent 15fa87b6
Loading
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -514,7 +514,14 @@ cleanup:
#ifdef DEBUG_SBA_AUDIO_DUMP
    IVAS_DEC_GetSbaDebugParams( hIvasDec, &numOutChannels, &numTransportChannels, &pca_ingest_channels );
#endif

#ifdef FIX_235
    if ( arg.hrtfReaderEnabled )
    {
        IVAS_DEC_HRTF_HANDLE hHrtfTD;
        IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD );
        dealloc_HRTF_binary( hHrtfTD );
    }
#endif
    IVAS_DEC_Close( &hIvasDec );
    CustomLsReader_close( &hLsCustomReader );
    hrtfFileReader_close( &hrtfReader );
+1 −0
Original line number Diff line number Diff line
@@ -149,6 +149,7 @@
#define MC_BITRATE_SWITCHING                            /* Issue 116: support bitrate switching in MC format  */
#define MC_JBM                                          /* FhG: extend JBM beyond mono for running IVAS in VoIP mode (contribution 19) */
#define FIX_265_MC_BRATE_SWITCHING                      /* Issue 265: fix use-of-uninitialized-value in MC bitrate switching */
#define FIX_235


/* ################## End DEVELOPMENT switches ######################### */
+2 −1
Original line number Diff line number Diff line
@@ -1713,12 +1713,13 @@ void ivas_destroy_dec(
    }
    else if ( st_ivas->hHrtfTD != NULL )
    {
#ifndef FIX_235
        /* Case when HRTF filter is mistakenly specified but TD renderer was not active */
        if ( st_ivas->hHrtfTD->ModelParams.UseItdModel && !st_ivas->hHrtfTD->ModelParams.modelROM )
        {
            BSplineModelEvalITDDealloc( &st_ivas->hHrtfTD->ModelParamsITD );
        }

#endif
        BSplineModelEvalDealloc( &st_ivas->hHrtfTD->ModelParams, &st_ivas->hHrtfTD->ModelEval );

        ivas_HRTF_binary_close( &st_ivas->hHrtfTD );
+2 −1
Original line number Diff line number Diff line
@@ -210,12 +210,13 @@ ivas_error ivas_sba_dec_reinit(
    }
    else if ( st_ivas->hHrtfTD != NULL )
    {
#ifndef FIX_235
        /* Case when HRTF filter is mistakenly specified but TD renderer was not active */
        if ( st_ivas->hHrtfTD->ModelParams.UseItdModel && !st_ivas->hHrtfTD->ModelParams.modelROM )
        {
            BSplineModelEvalITDDealloc( &st_ivas->hHrtfTD->ModelParamsITD );
        }

#endif
        BSplineModelEvalDealloc( &st_ivas->hHrtfTD->ModelParams, &st_ivas->hHrtfTD->ModelEval );

        ivas_HRTF_binary_close( &st_ivas->hHrtfTD );
+0 −6
Original line number Diff line number Diff line
@@ -61,10 +61,8 @@ void BSplineModelEvalAlloc(
    ModelEval_t *modelEval /* i/o: Model evaluation structure */
)
{
#define WMC_TOOL_SKIP
    modelEval->hrfModL = (float *) malloc( model->K * sizeof( float ) );
    modelEval->hrfModR = (float *) malloc( model->K * sizeof( float ) );
#undef WMC_TOOL_SKIP

    return;
}
@@ -120,13 +118,11 @@ void DefaultBSplineModel(
    model->elevKSeq = (const float *) orange53_rom_elevKSeq;
    model->elevBsShape = (const float *) orange53_rom_elevBsShape;

#define WMC_TOOL_SKIP
    model->azimBsShape = (const float **) malloc( model->num_unique_azim_splines * sizeof( float * ) );
    model->azimBsShape[0] = (const float *) orange53_rom_azimBsShape;
    model->azimKSeq = (float **) malloc( 18 * sizeof( float * ) );
    model->azimKSeq[0] = (float *) malloc( 2 * sizeof( float * ) );
    model->azimKSeq[17] = (float *) malloc( 2 * sizeof( float * ) );
#undef WMC_TOOL_SKIP
    model->azimKSeq[0][0] = 0.0f;
    model->azimKSeq[17][0] = 0.0f;
    model->azimKSeq[0][1] = 360.0f;
@@ -134,9 +130,7 @@ void DefaultBSplineModel(

    for ( i = 1; i < 17; i++ )
    {
#define WMC_TOOL_SKIP
        model->azimKSeq[i] = (float *) malloc( model->azimDim2[i] * sizeof( float * ) ); /* azimDim2[i] = 91, i=2..15 */
#undef WMC_TOOL_SKIP
        for ( j = 0; j < model->azimDim2[i]; j++ )
        {
            model->azimKSeq[i][j] = (float) orange53_rom_azimSegSamples[0] * j;
Loading