From 0603217ad9ecfcb34f82f180a1887b19c27fbb02 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 23 Jan 2026 09:00:59 +0100 Subject: [PATCH] Add fix for Stereo CNG uninit value read under FIX_BASOP_2317_UNINIT_VALUE_IN_STEREO_CNG --- lib_com/options.h | 1 + lib_enc/ivas_stereo_dft_enc_fx.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index c7cd38dd8..7b964312d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -119,6 +119,7 @@ #define FIX_1500_ISM_MD_DTX /* VA: float issue 1500: fix ISM elevation metadata smoothing in DTX */ #define FIX_2348_REPLACE_FEC_ENC /* VA: basop issue 2348: replace FEC_encode_ivas_fx with FEC_encode_fx */ #define FIX_2338_HARM_GSC_GAIN_COMP /* VA: basop issue 2338: harmonization of band gain computation for both EVS and IVAS */ +#define FIX_BASOP_2317_UNINIT_VALUE_IN_STEREO_CNG /* Eri: Basop issue 2317: Uninitialized value read in case of DTX and BW switching */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/ivas_stereo_dft_enc_fx.c b/lib_enc/ivas_stereo_dft_enc_fx.c index 729df8737..d6af9caf0 100644 --- a/lib_enc/ivas_stereo_dft_enc_fx.c +++ b/lib_enc/ivas_stereo_dft_enc_fx.c @@ -3953,10 +3953,16 @@ static void stereo_dft_enc_compute_prm_fx( * Compute Side gains *-----------------------------------------------------------------*/ +#ifdef FIX_BASOP_2317_UNINIT_VALUE_IN_STEREO_CNG + Copy32( pSideGain, hStereoDft->sidSideGain_fx, STEREO_DFT_BAND_MAX ); /* Copy all sideGain values since BW change may be reverted during CNG */ +#endif + FOR( b = 0; b < hStereoDft->nbands; b++ ) { +#ifndef FIX_BASOP_2317_UNINIT_VALUE_IN_STEREO_CNG hStereoDft->sidSideGain_fx[b] = *( pSideGain + b ); move32(); +#endif /* Quantization */ IF( flag_quant ) -- GitLab