diff --git a/lib_com/options.h b/lib_com/options.h index c795c9b24faf8f3d6b77666c80b6f512d8c28626..d19f9ef2e36d4fb6a4f836730888c339cbb029bd 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -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 ################################## */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 95ebbcb1c7522a088c984519d4945611bdfa56e8..99894e4b62311a7a134c93d496ca53a1d5f64f32 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -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;