Commit 8e164867 authored by vaclav's avatar vaclav
Browse files

fix

parent 2ccfe120
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -4150,6 +4150,7 @@ static ivas_error load_hrtf_from_file(
        /*------------------------------------------------------------------------------------------*
         * Release HRTF binary data
         *------------------------------------------------------------------------------------------*/

#ifndef FIX_2249_MEMORY_LEAK_IN_SBA
        if ( !( binaural_renderer == IVAS_BIN_RENDERER_TYPE_TDREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) && binaural_renderer_sec != IVAS_BIN_RENDERER_TYPE_TDREND && hHrtfBinary->hHrtfTD != NULL )
        {
@@ -4279,7 +4280,9 @@ static ivas_error load_hrtf_from_file(
                }
            }
        }
#ifndef FIX_2249_MEMORY_LEAK_IN_SBA
    }
#endif

#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
    if ( ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_FASTCONV || binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND ) && OutputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
@@ -4319,6 +4322,9 @@ static ivas_error load_hrtf_from_file(
            }
        }
    }
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
}
#endif

    return IVAS_ERR_OK;
}
+5 −4
Original line number Diff line number Diff line
@@ -2989,6 +2989,10 @@ void ivas_destroy_dec(
    ivas_combined_orientation_close( &st_ivas->hCombinedOrientationData );

    /* Time Domain binaural renderer handle */
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
    ivas_td_binaural_close( &st_ivas->hBinRendererTd );
    ivas_HRTF_td_binary_close( &st_ivas->hHrtfTD );
#else
    if ( st_ivas->hBinRendererTd != NULL )
    {
        ivas_td_binaural_close( &st_ivas->hBinRendererTd );
@@ -2996,13 +3000,10 @@ void ivas_destroy_dec(

    if ( st_ivas->hHrtfTD != NULL )
    {
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
        ivas_HRTF_td_binary_close( &st_ivas->hHrtfTD );
#else
        BSplineModelEvalDealloc( &st_ivas->hHrtfTD->ModelParams, &st_ivas->hHrtfTD->ModelEval );
        ivas_HRTF_binary_close( &st_ivas->hHrtfTD );
#endif
    }
#endif

    /* CRend binaural renderer handle */
    ivas_HRTF_CRend_binary_close( &st_ivas->hHrtfCrend );
+8 −2
Original line number Diff line number Diff line
@@ -139,11 +139,17 @@ ivas_error ivas_reverb_HRTF_statistics_open(
    const int32_t output_Fs                   /* i  : output sampling rate      */
)
{
    if ( *hHrtfStatistics != NULL && ( *hHrtfStatistics )->fromROM == TRUE )
    if ( *hHrtfStatistics != NULL )
    {
        if( ( *hHrtfStatistics )->fromROM == TRUE )
        {
            return IVAS_ERROR( IVAS_ERR_INTERNAL, "HRTF statistics allocated but not initialized from binary file!\n" );
        }

        /* HRTF statistics loaded from binary file */
        return IVAS_ERR_OK;
    }

    if ( ( *hHrtfStatistics = (HRTFS_STATISTICS *) malloc( sizeof( HRTFS_STATISTICS ) ) ) == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for statistics HRTF tables!" );