Commit 06ca0cb5 authored by emerit's avatar emerit
Browse files

fix usan error

parent 9c8f8920
Loading
Loading
Loading
Loading
+16 −11
Original line number Diff line number Diff line
@@ -4291,7 +4291,8 @@ static ivas_error load_hrtf_from_file(
    {
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
        IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL;
        if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ) ) != IVAS_ERR_OK )
        int16_t initFromRom;
        if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics, &initFromRom ) ) != IVAS_ERR_OK )
#else
        if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfBinary->hHrtfStatistics ) ) != IVAS_ERR_OK )
#endif
@@ -4299,8 +4300,9 @@ static ivas_error load_hrtf_from_file(
            fprintf( stderr, "\nIVAS_DEC_GetHrtfStatisticsHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
            return error;
        }

#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
        if ( initFromRom )
        {
            if ( ( error = load_reverb_binary( *hHrtfStatistics, output_Fs, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK )
#else
        if ( ( error = load_reverb_binary( *hHrtfBinary->hHrtfStatistics, output_Fs, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK )
@@ -4320,6 +4322,9 @@ static ivas_error load_hrtf_from_file(
#endif
                }
            }
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
        }
#endif
    }

    return IVAS_ERR_OK;
+6 −4
Original line number Diff line number Diff line
@@ -1501,12 +1501,14 @@ ivas_error ivas_init_decoder(
    if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
    {
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
        if ( st_ivas->hHrtfStatistics == NULL )
        {
            /* Allocate HRTF statistics */
            if ( ( error = ivas_HRTF_statistics_binary_open( &( st_ivas->hHrtfStatistics ) ) ) != IVAS_ERR_OK )
            {
                return error;
            }

        }
        /* Init HRTF statistics */
        if ( ( error = ivas_HRTF_statistics_init_from_rom( &st_ivas->hHrtfStatistics, output_Fs ) ) != IVAS_ERR_OK )
#else
+10 −3
Original line number Diff line number Diff line
@@ -2898,15 +2898,22 @@ ivas_error IVAS_DEC_GetHrtfParamBinHandle(

ivas_error IVAS_DEC_GetHrtfStatisticsHandle(
    IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle       */
    IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics /* o  : HRTF statistics handle    */
    IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
    ,                          /* o  : HRTF statistics handle    */
    int16_t *intialisedFromRom /* o  : int16_t handle    */
#endif
)
{
    if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfStatistics == NULL )
    if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfStatistics == NULL || intialisedFromRom == NULL )
    {
        return IVAS_ERR_WRONG_PARAMS;
    }

    *hHrtfStatistics = &hIvasDec->st_ivas->hHrtfStatistics;
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
    *intialisedFromRom = hIvasDec->st_ivas->hHrtfStatistics->fromROM;
#endif

    return IVAS_ERR_OK;
}
+4 −1
Original line number Diff line number Diff line
@@ -462,7 +462,10 @@ ivas_error IVAS_DEC_GetHrtfParamBinHandle(

ivas_error IVAS_DEC_GetHrtfStatisticsHandle(
    IVAS_DEC_HANDLE hIvasDec,                           /* i/o: IVAS decoder handle                                             */
    IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics   /* o  : HRTF statistics handle                                          */
    IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics,  /* o  : HRTF statistics handle    */
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA    
    int16_t *intialisedFromRom                          /* o  : int16_t handle    */
#endif
);

ivas_error IVAS_DEC_HRTF_binary_open(