Commit 419f7985 authored by vaclav's avatar vaclav
Browse files

Merge branch '1388-msan-clang-18-use-of-uninitialized-value-in-ivas_init_decoder' into 'main'

Fix [MSAN Clang 18] use-of-uninitialized value in ivas_init_decoder

See merge request !2247
parents 30efc029 b663bd66
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@
#define FIX_HRTF_LEFTOVERS                              /* VA: HRTF updates - bring float main in line with BASOP main */
#define FIX_1384_MSAN_ivas_spar_dec_open                /* VA: issue 1386: fix use-of-uninitialized value in ivas_spar_dec_open() */
#define FIX_1384_MSAN_stereo_tcx_core_enc               /* VA: issue 1384: fix use-of-uninitialized value in stereo_tcx_core_enc() */
#define FIX_1388_MSAN_ivas_init_decoder                 /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */

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

+14 −0
Original line number Diff line number Diff line
@@ -857,12 +857,23 @@ ivas_error IVAS_DEC_FeedFrame_Serial(
{
    ivas_error error;

#ifdef FIX_1388_MSAN_ivas_init_decoder
    if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL )
    {
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

#endif
    if ( !hIvasDec->isInitialized )
    {
        /* Once first frame is fed, finish initialization in EVS Mono.
         * In IVAS mode, initialization is done in ivas_dec(). */
        if ( hIvasDec->mode == IVAS_DEC_MODE_EVS )
        {
#ifdef FIX_1388_MSAN_ivas_init_decoder
            hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = ACELP_8k00;

#endif
            if ( ( error = ivas_init_decoder( hIvasDec->st_ivas ) ) != IVAS_ERR_OK )
            {
                return error;
@@ -875,10 +886,12 @@ ivas_error IVAS_DEC_FeedFrame_Serial(
                st->prev_use_partial_copy = 0;
                hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = hIvasDec->hVoIP->hCurrentDataUnit->dataSize * FRAMES_PER_SEC;
            }
#ifndef FIX_1388_MSAN_ivas_init_decoder
            else
            {
                hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = ACELP_8k00;
            }
#endif
            hIvasDec->isInitialized = true;
        }
    }
@@ -908,6 +921,7 @@ ivas_error IVAS_DEC_FeedFrame_Serial(
            bfi = 2;
        }
    }

    if ( ( error = read_indices( hIvasDec->st_ivas, serial, num_bits, &hIvasDec->prev_ft_speech, &hIvasDec->CNG, bfi ) ) != IVAS_ERR_OK )
    {
        return error;