Commit e1df50ad authored by emerit's avatar emerit
Browse files

fix memory leaks

parent 55e930ae
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1319,11 +1319,17 @@ static ivas_error TDREND_MIX_LoadHRTF(
    {
        if ( read_hrtf_binary_header( &hrtf_header, f_hrtf ) != IVAS_ERR_OK )
        {
#ifdef FIX_989_TD_REND_ROM
            free( hrtf_data );
#endif
            return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "HRTF binary file not compliant (number of HRTF)" );
        }

        if ( ( header_check_result = check_hrtf_binary_header( &hrtf_header ) ) != IVAS_ERR_OK )
        {
#ifdef FIX_989_TD_REND_ROM
            free( hrtf_data );
#endif
            return header_check_result;
        }

@@ -1332,6 +1338,9 @@ static ivas_error TDREND_MIX_LoadHRTF(
        {
            if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size )
            {
#ifdef FIX_989_TD_REND_ROM
                free( hrtf_data );
#endif
                return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF file reading" );
            }
        }
@@ -1340,6 +1349,7 @@ static ivas_error TDREND_MIX_LoadHRTF(
        {
            if ( hrtf_header.frequency != sampleRate )
            {
                free( hrtf_data );
                return IVAS_ERR_INVALID_HRTF_SAMPLING_RATE;
            }
        }
@@ -2902,6 +2912,7 @@ ivas_error load_fastconv_HRTF_from_binary(
        {
            if ( hrtf_header.frequency != 48000 ) /* note: Parametric renderer data are always stored at 48 kHz */
            {
                free( hrtf_data );
                return IVAS_ERR_INVALID_HRTF_SAMPLING_RATE;
            }
#else
@@ -3095,6 +3106,7 @@ ivas_error load_parambin_HRTF_from_binary(
#ifdef FIX_CREND_SIMPLIFY_CODE
            if ( hrtf_header.frequency != 48000 ) /* note: Parametric renderer data are always stored at 48 kHz */
            {
                free( hrtf_data );
                return IVAS_ERR_INVALID_HRTF_SAMPLING_RATE;
            }
#endif