From 7344fd6cfe8ebc4e7c92aa7c1621759f47818d91 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 16 Oct 2025 10:28:42 +0200 Subject: [PATCH] port FIX_1388_MSAN_ivas_init_decoder --- lib_com/options.h | 1 + lib_dec/lib_dec_fx.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index d963b98fa..9f97fc9ce 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -115,6 +115,7 @@ #define NONBE_FIX_1297_SPAR_JBM_MEM_SAN /* Dolby: issue 1297, SPAR + JBM + BR switch memory sanitizer */ #define NONBE_1303_GRANULARITY_OSBA_REND /* VA: issue 1303: Correctly set the granularity in OSBA, Disc mode, and BINAURAL_ROOM_REVERB output */ #define NONBE_1303_REND_GRANULARITY /* VA: issue 1303: Renderer granularity revision */ +#define FIX_1388_MSAN_ivas_init_decoder /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */ // object-editing feature porting #define OBJ_EDITING_API /* object editing changes related to the API */ diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 67c602eed..125b8f238 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -1003,12 +1003,25 @@ ivas_error IVAS_DEC_FeedFrame_Serial( { ivas_error error; +#ifdef FIX_1388_MSAN_ivas_init_decoder + test(); + 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( EQ_16( hIvasDec->mode, IVAS_DEC_MODE_EVS ) ) { +#ifdef FIX_1388_MSAN_ivas_init_decoder + hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = ACELP_8k00; + move32(); + +#endif IF( NE_32( ( error = ivas_init_decoder_fx( hIvasDec->st_ivas ) ), IVAS_ERR_OK ) ) { return error; @@ -1034,11 +1047,13 @@ ivas_error IVAS_DEC_FeedFrame_Serial( hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = imult3216( hIvasDec->hVoIP->hCurrentDataUnit->dataSize, FRAMES_PER_SEC ); move32(); } +#ifndef FIX_1388_MSAN_ivas_init_decoder ELSE { hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = ACELP_8k00; move32(); } +#endif hIvasDec->isInitialized = true; move16(); } -- GitLab