Commit 0d5596b5 authored by hsd's avatar hsd
Browse files

[add] TD5_FIX_INVALID_MEMORY_ACCESS flag. Resolves segfault in case...

[add] TD5_FIX_INVALID_MEMORY_ACCESS flag. Resolves segfault in case IVAS_REND_InitConfig gets initialized with rendererConfigEnabled:=false && ISM are being rendered.
parent 1e1670bb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -150,6 +150,7 @@
#define FIX_372_LIB_REND_VALIDATE_IO                    /* FhG: Issue 372: IVAS_rend segfaults with unsupported I/O configs - add validation checks of I/O config */
#define FIX_376_SBA_ROTATE                              /*DLB: Fix for issue 376*/
#define TD5                                             /* Eri: Contribution 17: Extended metadata for 6 DoF rendering in TD renderer */
#define TD5_FIX_INVALID_MEMORY_ACCESS                   /* FhG: Resolves segfault in case IVAS_REND_InitConfig gets initialized with rendererConfigEnabled:=false && ISM are being rendered */

#ifdef FIX_I109_ORIENTATION_TRACKING
#define OTR_REFERENCE_VECTOR_TRACKING                 /* FhG: enables the reference position orientation tracking mode */
+24 −0
Original line number Diff line number Diff line
@@ -201,9 +201,24 @@ ivas_error ivas_td_binaural_open_unwrap(
    if ( ivas_format == ISM_FORMAT )
    {
        DirAtten_p = pBinRendTd->DirAtten_p;
#ifdef TD5_FIX_INVALID_MEMORY_ACCESS
        if(NULL == directivity)
        {
          DirAtten_p->ConeInnerAngle = 360.0f; /* Front cone */
          DirAtten_p->ConeOuterAngle = 360.0f; /* Back cone */
          DirAtten_p->ConeOuterGain = 1.0f;   /* Back attenuation */
        }
        else
        {
          DirAtten_p->ConeInnerAngle = directivity[0];
          DirAtten_p->ConeOuterAngle = directivity[1];
          DirAtten_p->ConeOuterGain = directivity[2];
        }
#else
        DirAtten_p->ConeInnerAngle = directivity[0];
        DirAtten_p->ConeOuterAngle = directivity[1];
        DirAtten_p->ConeOuterGain = directivity[2];
#endif

        for ( nS = 0; nS < nchan_rend; nS++ )
        {
@@ -575,6 +590,9 @@ ivas_error ivas_td_binaural_open_ext(
    IVAS_FORMAT ivas_format;
    IVAS_OUTPUT_SETUP hTransSetup;
    ivas_error error;
#ifdef TD5_FIX_INVALID_MEMORY_ACCESS
    float* directivity = NULL;
#endif

    if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
    {
@@ -594,7 +612,13 @@ ivas_error ivas_td_binaural_open_ext(
    hTransSetup.ls_elevation = customLsInput->ls_elevation;

#ifdef TD5
#ifdef TD5_FIX_INVALID_MEMORY_ACCESS
    if(NULL != hRendCfg)
      directivity = hRendCfg->directivity;
    return ivas_td_binaural_open_unwrap( &pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, directivity, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns );
#else
    return ivas_td_binaural_open_unwrap( &pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, hRendCfg->directivity, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns );
#endif
#else
    return ivas_td_binaural_open_unwrap( &pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns );
#endif