Commit aee6cf7c authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[fix] BRIR memory allocation being skipped due to function return when...

[fix] BRIR memory allocation being skipped  due to function return when loading from file if HRIR memory is already allocated
parent d4574f97
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@
//#define FIX_CREND_SIMPLIFY_CODE                         /* Ora : simplify line code in crend */
#define FLOAT_FIX_POINT_HRTF_FILE_FORMAT                /* allows reading floation or fix point hrtf binary file format */
#define FIX_1082_INSTRUM_FAILED_LC3PLUS                 /* VoiceAge: issue 1082: fix ambiguous syntax in LC3Plus code leading to fails of instrumented builds */
#define FIX_1115_FASTCONV_HRTF_FILE_LOAD                /* FhG: issue 1115: fix crash when loading FastConv-only binary HRTF file */


#define FIX_1099_JBM_MD_HANDLE_ALLOC                    /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */
+8 −0
Original line number Diff line number Diff line
@@ -685,11 +685,15 @@ ivas_error ivas_allocate_binaural_hrtf(

    if ( renderer_type == RENDERER_BINAURAL_FASTCONV || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED )
    {
#ifndef FIX_1115_FASTCONV_HRTF_FILE_LOAD
        if ( ( HrtfFastConv->leftHRIRReal != NULL ) && ( HrtfFastConv->leftHRIRImag != NULL ) && ( HrtfFastConv->rightHRIRReal != NULL ) && ( HrtfFastConv->rightHRIRImag != NULL ) )
        {
            return IVAS_ERR_OK;
        }
        else
#else
        if ( ( HrtfFastConv->leftHRIRReal == NULL ) && ( HrtfFastConv->leftHRIRImag == NULL ) && ( HrtfFastConv->rightHRIRReal == NULL ) && ( HrtfFastConv->rightHRIRImag == NULL ) )
#endif
        {

            if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRReal, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, BINAURAL_NTAPS, allocate_init_flag ) )
@@ -713,11 +717,15 @@ ivas_error ivas_allocate_binaural_hrtf(

    if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED )
    {
#ifndef FIX_1115_FASTCONV_HRTF_FILE_LOAD
        if ( ( HrtfFastConv->leftBRIRReal != NULL ) && ( HrtfFastConv->leftBRIRImag != NULL ) && ( HrtfFastConv->rightBRIRReal != NULL ) && ( HrtfFastConv->rightBRIRImag != NULL ) )
        {
            return IVAS_ERR_OK;
        }
        else
#else
        if ( ( HrtfFastConv->leftBRIRReal == NULL ) && ( HrtfFastConv->leftBRIRImag == NULL ) && ( HrtfFastConv->rightBRIRReal == NULL ) && ( HrtfFastConv->rightBRIRImag == NULL ) )
#endif
        {
            if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftBRIRReal, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, BINAURAL_NTAPS_MAX, allocate_init_flag ) )
            {