From 729dfd8c083639feb891c5a1a7ce6bfdbdf0e0c9 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 16 Oct 2025 10:21:21 +0200 Subject: [PATCH] port FIX_1388_MSAN_ivas_init_decoder --- lib_com/options.h | 1 + lib_dec/lib_dec.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index bf949b6e2..635caa6e5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -195,6 +195,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.c b/lib_dec/lib_dec.c index abba30ea6..84655c54b 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -840,12 +840,24 @@ 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; @@ -858,10 +870,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; } } -- GitLab