diff --git a/lib_com/options.h b/lib_com/options.h index 7def4b0b4ffd9e69391f35b64b9fe5c1a2345c0f..e50a0608cb43b49c963da9b796976154a708d2ea 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -170,6 +170,7 @@ #define FIX_1123_PARAMBIN_16BIT_ROM /* FhG,Nok: issue 1123: update ParamBin ROM tables and scripts to generate 16 bit tables instead of float */ #define FIX_RETURN /* VA: fix location of function returns */ #endif +#define FIX_1152_UNINIT_VAL_IN_ITD_VAD_COMPUTATION /* FhG: fix uninitialized value being used in ITD VAD mid signal computation that does not affect synthesis, but crashes BASOPs */ /* #################### End BE switches ################################## */ diff --git a/lib_enc/ivas_stereo_dft_enc_itd.c b/lib_enc/ivas_stereo_dft_enc_itd.c index 0476f354230666243e5e5a287747003daebdee70..0f32dd9985e29b0ee8fa38cedf11669f6ced0657 100644 --- a/lib_enc/ivas_stereo_dft_enc_itd.c +++ b/lib_enc/ivas_stereo_dft_enc_itd.c @@ -288,7 +288,13 @@ static int16_t stereo_dft_enc_itd_vad( float Spd[STEREO_DFT_N_16k_ENC / 2 + 1]; +#ifdef FIX_1152_UNINIT_VAL_IN_ITD_VAD_COMPUTATION + /* Spd is later only used starting at itd_vad_band_tbl[0], so only compute values starting from there */ + /* -> this avoids uninitialized values in Spd_L and Spd_R at index 0 to be used */ + for ( i = itd_vad_band_tbl[0]; i <= STEREO_DFT_N_16k_ENC / 2; i++ ) +#else for ( i = 0; i <= STEREO_DFT_N_16k_ENC / 2; i++ ) +#endif { Spd[i] = 0.5f * ( Spd_L[i] + Spd_R[i] ); }