Commit 00b5cd44 authored by Jan Kiene's avatar Jan Kiene
Browse files

fix clang18 MSAN complaint in decoder init

parent 867217ee
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -162,6 +162,7 @@
/*#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_CLANG18_MSAN_IN_DEC_INIT_BY_MOVING_COMMON_INITS_TOGETHER /* FhG: fix CLANG18 MSAN error in decoder init */

/* #################### End BE switches ################################## */

+18 −6
Original line number Diff line number Diff line
@@ -219,36 +219,48 @@ ivas_error IVAS_DEC_Open(
    st_ivas->restartNeeded = 0;

    /* set high-level parameters */
#ifdef FIX_CLANG18_MSAN_IN_DEC_INIT_BY_MOVING_COMMON_INITS_TOGETHER

    st_ivas->codec_mode = 0; /* unknown before first frame */
    st_ivas->transport_config = IVAS_AUDIO_CONFIG_INVALID;
    st_ivas->intern_config = IVAS_AUDIO_CONFIG_INVALID;
    st_ivas->writeFECoffset = 0;
    st_ivas->sba_analysis_order = 0; /* not really used in EVS mode, but initialize here to fix MSAN complaint */
#endif

    if ( mode == IVAS_DEC_MODE_EVS )
    {
#ifndef FIX_CLANG18_MSAN_IN_DEC_INIT_BY_MOVING_COMMON_INITS_TOGETHER
        st_ivas->codec_mode = 0; /* unknown before first frame */
        st_ivas->element_mode_init = EVS_MONO;
        st_ivas->ivas_format = MONO_FORMAT;
        st_ivas->transport_config = IVAS_AUDIO_CONFIG_INVALID;
        st_ivas->intern_config = IVAS_AUDIO_CONFIG_INVALID;
        st_ivas->writeFECoffset = 0;
#endif
        st_ivas->element_mode_init = EVS_MONO;
        st_ivas->ivas_format = MONO_FORMAT;
        hIvasDec->hasDecodedFirstGoodFrame = true; /* Functionality to suppress output for initial lost frames is disabled in EVS operation */

        return IVAS_ERR_OK;
    }
    else if ( mode == IVAS_DEC_MODE_IVAS )
    {
#ifndef FIX_CLANG18_MSAN_IN_DEC_INIT_BY_MOVING_COMMON_INITS_TOGETHER
        st_ivas->codec_mode = 0; /* unknown before first frame */
        st_ivas->element_mode_init = -1;
        st_ivas->ivas_format = UNDEFINED_FORMAT;
        st_ivas->transport_config = IVAS_AUDIO_CONFIG_INVALID;
        st_ivas->intern_config = IVAS_AUDIO_CONFIG_INVALID;
        st_ivas->writeFECoffset = 0;
#endif
        st_ivas->element_mode_init = -1;
        st_ivas->ivas_format = UNDEFINED_FORMAT;
        st_ivas->renderer_type = RENDERER_DISABLE;
        st_ivas->ini_frame = 0;
        st_ivas->ini_active_frame = 0;
        st_ivas->writeFECoffset = 0;

        st_ivas->ism_mode = ISM_MODE_NONE;
        st_ivas->mc_mode = MC_MODE_NONE;

        st_ivas->sba_order = 0;
        st_ivas->sba_planar = 0;
        st_ivas->sba_analysis_order = 0;

        return IVAS_ERR_OK;
    }