Unverified Commit d1e0136f authored by norvell's avatar norvell
Browse files

Fix a few free statements

parent 1cf4cd60
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -872,17 +872,25 @@ void BSplineModelEvalDealloc_fx(

    IF( model->modelROM )
    {
#ifndef FIX_2235_TD_RENDERER_WORD16
        FOR( i = 0; i < model->num_unique_azim_splines; i++ )
        {
            free( model->azimBsShape_dyn_fx[i] );
        }
        free( model->azimBsShape_dyn_fx );
#endif
        free( (void *) model->azimBsShape_fx ); /* void* cast needed to please both gcc and Visual studio compilers. Deallocating const float** should be fine and gcc agrees, but Visual studio complains. */
#ifdef FIX_2235_TD_RENDERER_WORD16
        free( model->azimBsShape_Q_fx );
#endif
        FOR( i = 0; i < model->elevDim3; i++ )
        {
            free( model->azimKSeq_fx[i] );
        }
        free( model->azimKSeq_fx );
#ifdef FIX_2235_TD_RENDERER_WORD16
        free( model->azimKSeq_Q_fx );
#endif
        IF( modelEval != NULL )
        {
            free( modelEval->hrfModL_fx );
+4 −9
Original line number Diff line number Diff line
@@ -151,27 +151,23 @@ void TDREND_MIX_Dealloc_fx(
        {
            BSplineModelEvalDealloc_fx( &hBinRendererTd->HrFiltSet_p->ModelParams, &hBinRendererTd->HrFiltSet_p->ModelEval );
        }
#ifndef FIX_2235_TD_RENDERER_WORD16
        IF( hBinRendererTd->HrFiltSet_p->ModelParams.modelROM )
        {
            IF( hBinRendererTd->HrFiltSet_p->ModelParams.UseItdModel )
            {
#ifndef FIX_2235_TD_RENDERER_WORD16
                free( hBinRendererTd->HrFiltSet_p->ModelParamsITD.elevKSeq_dyn_fx );
                free( hBinRendererTd->HrFiltSet_p->ModelParamsITD.azimKSeq_dyn_fx );
#endif
                free( hBinRendererTd->HrFiltSet_p->ModelParamsITD.W_dyn_fx );
                free( hBinRendererTd->HrFiltSet_p->ModelParamsITD.azimBsShape_dyn_fx );
                free( hBinRendererTd->HrFiltSet_p->ModelParamsITD.elevBsShape_dyn_fx );
            }
#ifndef FIX_2235_TD_RENDERER_WORD16
            free( hBinRendererTd->HrFiltSet_p->ModelParams.elevKSeq_dyn_fx );
            free( hBinRendererTd->HrFiltSet_p->ModelParams.AlphaL_dyn_fx );
            free( hBinRendererTd->HrFiltSet_p->ModelParams.AlphaR_dyn_fx );
#endif

            free( hBinRendererTd->HrFiltSet_p->ModelParams.elevBsShape_dyn_fx );
        }

#endif

        IF( EQ_16( hBinRendererTd->HrFiltSet_p->ModelParams.modelROM, 1 ) )
        {
@@ -419,7 +415,7 @@ static ivas_error DefaultBSplineModel_fx(
    model->azimShapeSampFactor = defaultHRIR_rom_azimShapeSampFactor; // Q0

#ifdef FIX_2235_TD_RENDERER_WORD16
    model->elevKSeq_fx = (const Word16 *) defaultHRIR_rom_elevKSeq_fx;
    model->elevKSeq_fx = defaultHRIR_rom_elevKSeq_fx;
    model->elevKSeq_Q_fx = defaultHRIR_rom_elevKSeq_Q_fx;
#else
    model->elevKSeq_dyn_fx = (Word32 *) malloc( ( model->elevDim3 - 2 ) * sizeof( Word32 ) );
@@ -449,18 +445,17 @@ static ivas_error DefaultBSplineModel_fx(
    {
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) );
    }
    model->azimBsShape_dyn_fx = (Word16 **) malloc( sizeof( Word16 * ) );
#else
    IF( ( model->azimBsShape_fx = (const Word32 **) malloc( model->num_unique_azim_splines * sizeof( Word32 * ) ) ) == NULL )
    {
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) );
    }
    model->azimBsShape_dyn_fx = (Word32 **) malloc( sizeof( Word32 * ) );
#endif
    IF( model->azimBsShape_dyn_fx == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" );
    }
#endif
#ifdef FIX_2235_TD_RENDERER_WORD16
    model->azimBsShape_fx[0] = defaultHRIR_rom_azimBsShape_fx;
    model->azimBsShape_Q_fx[0] = defaultHRIR_rom_azimBsShape_Q_fx;