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

[fix] UBSAN when accessing render config

parent ad645443
Loading
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1356,9 +1356,10 @@ ivas_error ivas_init_decoder(
#ifdef FIX_1419_MONO_STEREO_UMX

    /* Override transport config values from render config */
    if ( st_ivas->ivas_format == MONO_FORMAT || st_ivas->ivas_format == STEREO_FORMAT )
    if ( ( st_ivas->ivas_format == MONO_FORMAT || st_ivas->ivas_format == STEREO_FORMAT ) &&
         st_ivas->hRenderConfig != NULL &&
         st_ivas->hRenderConfig->mono_stereo_upmix_config.spatialEnabled )
    {
        // TODO check status of render config; is this a sanitizer issue if it is not always enabled?
        st_ivas->hTransSetup.ls_azimuth = st_ivas->hRenderConfig->mono_stereo_upmix_config.azi;
        st_ivas->hTransSetup.ls_elevation = st_ivas->hRenderConfig->mono_stereo_upmix_config.ele;
    }