Commit fc3f1673 authored by emerit's avatar emerit
Browse files

fix issue

parent 9f5b3218
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define FIX_1435_MOVE_STEREO_PANNING                    /* VA: issue 1435: do the EVS stereo panning in the renderer */
#define FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND /* OR : Fix issue basop 2201 hrtf_file_reader crend differs between basop ivas-main and ivas-float-update */
#define FIX_2249_MEMORY_LEAK_IN_SBA                     /* OR : issue 2249 : Memory leak in SBA to BINAURAL_ROOM_REVERB with memory instrumentation */

/* #################### End BE switches ################################## */

+31 −0
Original line number Diff line number Diff line
@@ -424,3 +424,34 @@ ivas_error ivas_HRTF_statistics_init_fx(

    return IVAS_ERR_OK;
}

#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
/*---------------------------------------------------------------------*
 * ivas_HRTF_statistics_destroy_fx()
 *
 * Destroy the HRTF statistics set.
 *---------------------------------------------------------------------*/

void ivas_HRTF_statistics_destroy_fx(
    IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics /* i/o: HRTF statistics handle  */
)
{
    if ( ( hHrtfStatistics != NULL ) && ( *hHrtfStatistics != NULL ) && ( ( *hHrtfStatistics )->fromROM == FALSE ) )
    {
        if ( ( *hHrtfStatistics )->average_energy_l_dyn != NULL )
        {
            free( ( *hHrtfStatistics )->average_energy_l_dyn );
        }
        if ( ( *hHrtfStatistics )->average_energy_r_dyn != NULL )
        {
            free( ( *hHrtfStatistics )->average_energy_r_dyn );
        }
        if ( ( *hHrtfStatistics )->inter_aural_coherence_dyn != NULL )
        {
            free( ( *hHrtfStatistics )->inter_aural_coherence_dyn );
        }
    }

    return;
}
#endif
 No newline at end of file
+6 −0
Original line number Diff line number Diff line
@@ -621,6 +621,12 @@ ivas_error ivas_HRTF_statistics_init_fx(
    const Word32 sampleRate                                     /* i  : Sample rate                             */
);

#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
void ivas_HRTF_statistics_destroy_fx(
    IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics            /* i/o: HRTF statistics handle  */
);
#endif

void ivas_HRTF_statistics_close_fx(
    HRTFS_STATISTICS **hHrtfStatistics                          /* i/o: HRTF statistics structure               */
);
+4 −1
Original line number Diff line number Diff line
@@ -2071,6 +2071,9 @@ void destroy_hrtf_statistics(
    IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics /* i/o: HRTF statistics handle  */
)
{
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
    ivas_HRTF_statistics_destroy_fx( hHrtfStatistics );
#else
    if ( ( hHrtfStatistics != NULL ) && ( *hHrtfStatistics != NULL ) && ( ( *hHrtfStatistics )->fromROM == FALSE ) )
    {
        if ( ( *hHrtfStatistics )->average_energy_l_dyn != NULL )
@@ -2086,7 +2089,7 @@ void destroy_hrtf_statistics(
            free( ( *hHrtfStatistics )->inter_aural_coherence_dyn );
        }
    }

#endif
    ivas_HRTF_statistics_close_fx( hHrtfStatistics );

    return;