Commit 5552d2c0 authored by emerit's avatar emerit
Browse files

fix usan and missing switch

parent aad36a65
Loading
Loading
Loading
Loading
Loading
+17 −11
Original line number Diff line number Diff line
@@ -740,7 +740,6 @@ cleanup:
        destroy_td_hrtf( hHrtfBinary.hHrtfTD );
        destroy_hrtf_statistics( hHrtfBinary.hHrtfStatistics );
    }
#endif
#ifdef FIX_1990_SANITIZER_IN_REVERB_LOAD
    // TODO:
    /* This free differs from float version.
@@ -748,6 +747,7 @@ cleanup:
    IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL;
    IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics );
    destroy_hrtf_statistics( hHrtfStatistics );
#endif
#endif
    IVAS_DEC_Close( &hIvasDec );
    CustomLsReader_close( &hLsCustomReader );
@@ -3901,7 +3901,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 )
        Word16 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
@@ -3911,6 +3912,8 @@ static ivas_error load_hrtf_from_file(
        }

#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 )
@@ -3930,6 +3933,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
@@ -1800,12 +1800,14 @@ ivas_error ivas_init_decoder_fx(
    {
        /* Init HRTF statistics */
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
        if ( st_ivas->hHrtfStatistics == NULL )
        {
            /* Allocate HRTF statistics */
            IF( NE_32( ( error = ivas_HRTF_statistics_binary_open_fx( &( st_ivas->hHrtfStatistics ) ) ), IVAS_ERR_OK ) )
            {
                return error;
            }

        }
        /* Init HRTF statistics */
        IF( NE_32( ( error = ivas_HRTF_statistics_init_from_rom_fx( &st_ivas->hHrtfStatistics, output_Fs ) ), IVAS_ERR_OK ) )
#else
+5 −0
Original line number Diff line number Diff line
@@ -440,6 +440,11 @@ 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                                                  */
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
    ,                          							/* o  : HRTF statistics handle    */
    Word16 *intialisedFromRom 							/* o  : int16_t handle    */
#endif

);

ivas_error IVAS_DEC_HRTF_binary_open(
+13 −2
Original line number Diff line number Diff line
@@ -2471,17 +2471,28 @@ 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    */
    Word16 *intialisedFromRom /* o  : int16_t handle    */
#endif
)
{
    test();
    test();
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
    IF( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfStatistics == NULL || intialisedFromRom == NULL )
#else
    IF( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfStatistics == NULL )
#endif
    {
        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;
}
+8 −4
Original line number Diff line number Diff line
@@ -466,16 +466,20 @@ ivas_error ivas_HRTF_statistics_binary_open_fx(
    return IVAS_ERR_OK;
}

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

#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
void ivas_HRTF_statistics_binary_close_fx(
    IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics /* i/o: HRTF statistics handle  */
)
#else
void ivas_HRTF_statistics_close_fx(
    IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics /* i/o: HRTF statistics handle  */
)
#endif
{
    test();
    IF( hHrtfStatistics == NULL || *hHrtfStatistics == NULL )
@@ -506,7 +510,7 @@ void ivas_HRTF_statistics_binary_close_fx(

    return;
}
#endif


/*-----------------------------------------------------------------------*
 * ivas_HRTF_statistics_init()