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

[fix] missing checks for valid MC input

parent d69b86f6
Loading
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -2301,7 +2301,7 @@ static ivas_error initMcBinauralRendering(
        }
    }
#ifdef FIX_513_REND_MC_ALLOC
    else if ( !useTDRend && inputMc->crendWrapper->hCrend == NULL ) /* open CREND */
    else if ( !useTDRend && inputMc->crendWrapper == NULL ) /* open CREND */
#endif
    {
        if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == AUDIO_CONFIG_LS_CUSTOM ) ? AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, NULL, outSampleRate
@@ -5338,12 +5338,15 @@ ivas_error IVAS_REND_SetHeadRotation(
    /* reconfigure binaural rendering to allocate
       the necessary renderers and free unused ones */
    for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i )
    {
        if ( hIvasRend->inputsMc[i].base.inConfig != AUDIO_CONFIG_INVALID )
        {
            initMcBinauralRendering( &hIvasRend->inputsMc[i],
                                     hIvasRend->inputsMc[i].base.inConfig,
                                     hIvasRend->outputConfig,
                                     hIvasRend->hRendererConfig );
        }
    }
#endif

#ifdef API_5MS
@@ -5447,6 +5450,8 @@ IVAS_REND_DisableHeadRotation(
    if ( getAudioConfigType( hIvasRend->outputConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL )
    {
        for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i )
        {
            if ( hIvasRend->inputsMc[i].base.inConfig != AUDIO_CONFIG_INVALID )
            {
                initMcBinauralRendering( &hIvasRend->inputsMc[i],
                                         hIvasRend->inputsMc[i].base.inConfig,
@@ -5454,6 +5459,7 @@ IVAS_REND_DisableHeadRotation(
                                         hIvasRend->hRendererConfig );
            }
        }
    }

#endif
    return IVAS_ERR_OK;