Commit 39902e01 authored by emerit's avatar emerit
Browse files

fix asan fail

parent ecf09edb
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -798,6 +798,7 @@ int main(
        if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK )
        {
#ifdef FIX_OLD_BINARY_FORMAT
            cleanup_SetOfHRTF(hSetOfHRTF);
            hrtfFileReader_close( &hrtfReader );
            strcat( arg.hrtfFileName, "new" );

+1 −0
Original line number Diff line number Diff line
@@ -1095,6 +1095,7 @@ int main(
            if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfFileReader, args.sampleRate ) ) != IVAS_ERR_OK )
            {
#ifdef FIX_OLD_BINARY_FORMAT
                cleanup_SetOfHRTF(hSetOfHRTF);
                hrtfFileReader_close( &hrtfFileReader );
                strcat( args.customHrtfFilePath, "new" );
                if ( hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ) != IVAS_ERR_OK )
+25 −2
Original line number Diff line number Diff line
@@ -929,7 +929,7 @@ static void HRTF_energy_sections_precalc(

#ifdef NONBE_FIX_BINARY_BINAURAL_READING
/*---------------------------------------------------------------------*
 * dealloc_HRTF_binary()
 * destroy_td_hrtf()
 *
 * Deallocated memory allocated by load_HRTF_binary
 *---------------------------------------------------------------------*/
@@ -2167,13 +2167,36 @@ static ivas_error destroy_HRTF(
}


#ifdef NONBE_FIX_BINARY_BINAURAL_READING
/*---------------------------------------------------------------------*
 * destroy_SetOfHRTF()
 *
 * Destroy the HRTF data set.
 *---------------------------------------------------------------------*/
#ifdef FIX_OLD_BINARY_FORMAT
/*---------------------------------------------------------------------*
 * cleanup_SetOfHRTF()
 *
 * Destroy the HRTF data set.
 *---------------------------------------------------------------------*/

void cleanup_SetOfHRTF(
    HRTFS_CREND_HANDLE *hSetOfHRTF /* i/o: Set of HRTF CRend handle */
)
{
    if ( ( hSetOfHRTF != NULL ) && ( *hSetOfHRTF != NULL ) )
    {
        destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_hrir_combined ) );
        destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_hrir_hoa3 ) );
        destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_hrir_hoa2 ) );
        destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_hrir_foa ) );
        destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_brir_combined ) );
    }

    return;
}
#endif

#ifdef NONBE_FIX_BINARY_BINAURAL_READING
void destroy_SetOfHRTF(
    HRTFS_CREND_HANDLE *hSetOfHRTF /* i/o: Set of HRTF CRend handle */
)
+11 −0
Original line number Diff line number Diff line
@@ -117,6 +117,17 @@ ivas_error create_SetOfHRTF_from_binary(
    int32_t output_Fs                      /* i  : Output sampling frequency            */
);

#ifdef FIX_OLD_BINARY_FORMAT
/*---------------------------------------------------------------------*
 * cleanup_SetOfHRTF()
 *
 * Destroy the HRTF data set.
 *---------------------------------------------------------------------*/

void cleanup_SetOfHRTF(
    IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF /* i/o: Set of HRTF CRend handle */
);
#endif

/*---------------------------------------------------------------------*
 * destroy_SetOfHRTF()