Commit 10420cb9 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_1495_INCORRECT_FREAD_CALL

parent 2d9392fc
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -162,7 +162,6 @@
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#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_1495_INCORRECT_FREAD_CALL                   /* Eri: Switched size and number of elements in fread call. */
#define FIX_1494_SET_SPLITBFI_UNUSED                    /* Dolby: Fix issue 1494, remove unused function setting BFI flag in ISAR renderer */
#define FIX_1479_MSAN_SPAR_UNINITIALIZED_VALUE          /* Dolby: Fix for issue 1479, MSAN error due to uninitialized value in SPAR */
#define REMOVE_UNUSED_CODE_IVAS_DEC                     /* VA: remove unused code in ivas_jbm_dec_tc_fx() */
+0 −60
Original line number Diff line number Diff line
@@ -302,11 +302,7 @@ static ivas_error TDREND_LoadBSplineBinaryITD(
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" );
    }
#ifdef FIX_1495_INCORRECT_FREAD_CALL
    fread( &factor_Q, sizeof( int16_t ), 1, f_hrtf );
#else
    fread( &factor_Q, 1, sizeof( int16_t ), f_hrtf );
#endif
    q_scale = powf( 2.f, -1.f * factor_Q );
    fread( v_tmp16, sizeof( int16_t ), modelITD->elevDim3 - 2, f_hrtf );
    for ( j = 0; j < modelITD->elevDim3 - 2; j++ )
@@ -322,11 +318,7 @@ static ivas_error TDREND_LoadBSplineBinaryITD(
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" );
    }
#ifdef FIX_1495_INCORRECT_FREAD_CALL
    fread( &factor_Q, sizeof( int16_t ), 1, f_hrtf );
#else
    fread( &factor_Q, 1, sizeof( int16_t ), f_hrtf );
#endif
    q_scale = powf( 2.f, -1.f * factor_Q );
    fread( v_tmp16, sizeof( int16_t ), ( modelITD->azimDim3 + 1 ) / 2 - 2, f_hrtf );
    for ( j = 0; j < ( modelITD->azimDim3 + 1 ) / 2 - 2; j++ )
@@ -342,11 +334,7 @@ static ivas_error TDREND_LoadBSplineBinaryITD(
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" );
    }

#ifdef FIX_1495_INCORRECT_FREAD_CALL
    fread( &factor_Q, sizeof( int16_t ), 1, f_hrtf );
#else
    fread( &factor_Q, 1, sizeof( int16_t ), f_hrtf );
#endif
    q_scale = powf( 2.f, -1.f * factor_Q );
    v_tmp16 = (int16_t *) malloc( tmp * sizeof( int16_t ) );
    if ( v_tmp16 == NULL )
@@ -381,11 +369,7 @@ static ivas_error TDREND_LoadBSplineBinaryITD(
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" );
    }
#ifdef FIX_1495_INCORRECT_FREAD_CALL
    fread( &factor_Q, sizeof( int16_t ), 1, f_hrtf );
#else
    fread( &factor_Q, 1, sizeof( int16_t ), f_hrtf );
#endif
    q_scale = powf( 2.f, -1.f * factor_Q );
    fread( v_tmp16, sizeof( int16_t ), tmp, f_hrtf );
    for ( j = 0; j < tmp; j++ )
@@ -422,11 +406,7 @@ static ivas_error TDREND_LoadBSplineBinaryITD(
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" );
    }
#ifdef FIX_1495_INCORRECT_FREAD_CALL
    fread( &factor_Q, sizeof( int16_t ), 1, f_hrtf );
#else
    fread( &factor_Q, 1, sizeof( int16_t ), f_hrtf );
#endif
    q_scale = powf( 2.f, -1.f * factor_Q );
    fread( v_tmp16, sizeof( int16_t ), tmp, f_hrtf );
    for ( j = 0; j < tmp; j++ )
@@ -472,17 +452,9 @@ static ivas_error TDREND_LoadBSplineBinary(
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

#ifdef FIX_1495_INCORRECT_FREAD_CALL
    fread( &factor_Q, sizeof( int16_t ), 1, f_hrtf );
#else
    fread( &factor_Q, 1, sizeof( int16_t ), f_hrtf );
#endif
    q_scale = powf( 2.f, -1.f * factor_Q );
#ifdef FIX_1495_INCORRECT_FREAD_CALL
    fread( &tmp32, sizeof( int32_t ), 1, f_hrtf );
#else
    fread( &tmp32, 1, sizeof( int32_t ), f_hrtf );
#endif
    HrFiltSet_p->latency_s = tmp32 * q_scale;

    model = &( HrFiltSet_p->ModelParams );
@@ -529,11 +501,7 @@ static ivas_error TDREND_LoadBSplineBinary(
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" );
    }
#ifdef FIX_1495_INCORRECT_FREAD_CALL
    fread( &factor_Q, sizeof( int16_t ), 1, f_hrtf );
#else
    fread( &factor_Q, 1, sizeof( int16_t ), f_hrtf );
#endif
    q_scale = powf( 2.f, -1.f * factor_Q );
    fread( v_tmp16, sizeof( int16_t ), model->elevDim3 - 2, f_hrtf );
    for ( j = 0; j < model->elevDim3 - 2; j++ )
@@ -561,11 +529,7 @@ static ivas_error TDREND_LoadBSplineBinary(
        {
            return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" );
        }
#ifdef FIX_1495_INCORRECT_FREAD_CALL
        fread( &factor_Q, sizeof( int16_t ), 1, f_hrtf );
#else
        fread( &factor_Q, 1, sizeof( int16_t ), f_hrtf );
#endif
        q_scale = powf( 2.f, -1.f * factor_Q );
        fread( v_tmp16, sizeof( int16_t ), ( model->azimDim3_dyn[i] + 1 ), f_hrtf );
        for ( j = 0; j < model->azimDim3_dyn[i] + 1; j++ )
@@ -582,11 +546,7 @@ static ivas_error TDREND_LoadBSplineBinary(
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" );
    }
#ifdef FIX_1495_INCORRECT_FREAD_CALL
    fread( &factor_Q, sizeof( int16_t ), 1, f_hrtf );
#else
    fread( &factor_Q, 1, sizeof( int16_t ), f_hrtf );
#endif
    q_scale = powf( 2.f, -1.f * factor_Q );

    fread( v_tmp16, sizeof( int16_t ), model->AlphaN * model->K, f_hrtf );
@@ -626,11 +586,7 @@ static ivas_error TDREND_LoadBSplineBinary(
        {
            return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" );
        }
#ifdef FIX_1495_INCORRECT_FREAD_CALL
        fread( &factor_Q, sizeof( int16_t ), 1, f_hrtf );
#else
        fread( &factor_Q, 1, sizeof( int16_t ), f_hrtf );
#endif
        q_scale = powf( 2.f, -1.f * factor_Q );
        v_tmp16 = (int16_t *) malloc( tmp * sizeof( int16_t ) );
        if ( v_tmp16 == NULL )
@@ -682,11 +638,7 @@ static ivas_error TDREND_LoadBSplineBinary(
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" );
    }

#ifdef FIX_1495_INCORRECT_FREAD_CALL
    fread( &factor_Q, sizeof( int16_t ), 1, f_hrtf );
#else
    fread( &factor_Q, 1, sizeof( int16_t ), f_hrtf );
#endif
    q_scale = powf( 2.f, -1.f * factor_Q );
    fread( v_tmp16, sizeof( int16_t ), tmp, f_hrtf );
    for ( j = 0; j < tmp; j++ )
@@ -702,11 +654,7 @@ static ivas_error TDREND_LoadBSplineBinary(
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" );
    }
#ifdef FIX_1495_INCORRECT_FREAD_CALL
    fread( &factor_Q, sizeof( int16_t ), 1, f_hrtf );
#else
    fread( &factor_Q, 1, sizeof( int16_t ), f_hrtf );
#endif
    q_scale = powf( 2.f, -1.f * factor_Q );

    fread( (int32_t *) model->EL_dyn, sizeof( int32_t ), model->AlphaN * HRTF_MODEL_N_SECTIONS, f_hrtf );
@@ -955,11 +903,7 @@ static ivas_error TDREND_MIX_LoadHRTF(

        /* try if it is old format for BE tests*/
        fseek( f_hrtf, 0, SEEK_SET );
#ifdef FIX_1495_INCORRECT_FREAD_CALL
        if ( fread( &tmp, sizeof( int16_t ), 1, f_hrtf ) == 0 )
#else
        if ( fread( &tmp, 1, sizeof( int16_t ), f_hrtf ) == 0 )
#endif
        {
            header_check_result = IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF file reading" );
        }
@@ -1031,11 +975,7 @@ static ivas_error TDREND_MIX_LoadHRTF(

    if ( is_tdrend )
    {
#ifdef FIX_1495_INCORRECT_FREAD_CALL
        if ( fread( &tmp, sizeof( int16_t ), 1, f_hrtf ) == 0 )
#else
        if ( fread( &tmp, 1, sizeof( int16_t ), f_hrtf ) == 0 )
#endif
        {
            return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF file reading" );
        }