diff --git a/lib_com/options.h b/lib_com/options.h index 57928ed19a69c0b744dfb665edfdfe5920951da2..af3057cf381c7f4b8b9cb4676db0f472aa4ee49c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,6 +164,8 @@ #define FIX_299_ISM_BWS /* VA: issue 299 - fix Band-width switching issues in ISM format */ #define FIX_309_PREMPH_MEM_SCE /* FhG: issue 309 - fix overwriting of mem_preemph_enc in ivas preprocessing for SCE and tcxonly modes*/ +#define FIX_317 /* FhG: issue 317 - address sanitizer error in MDCT-Stereo PLC */ + /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_stereo_mdct_stereo_dec.c b/lib_dec/ivas_stereo_mdct_stereo_dec.c index ebaaa9169311bc71b8afbda20b4da3ef3c57365c..963acdc16bfc0cdd65adb3f871b01ffcfe9af041 100644 --- a/lib_dec/ivas_stereo_mdct_stereo_dec.c +++ b/lib_dec/ivas_stereo_mdct_stereo_dec.c @@ -327,11 +327,19 @@ void stereo_decoder_tcx( hStereoMdct->reverse_dmx = 0; } +#ifdef FIX_317 + if ( ( nrgRatio > 1.0f ) && ( k < ( ( core_r == TCX_10_CORE ) ? NB_DIV : 1 ) ) ) +#else if ( ( nrgRatio > 1.0f ) && ( k < ( ( core_r == TCX_20_CORE ) ? 1 : NB_DIV ) ) ) +#endif { v_multc( spec_r[k], nrgRatio, spec_r[k], L_frameTCX_r ); } +#ifdef FIX_317 + else if ( ( nrgRatio < 1.0f ) && ( k < ( ( core_l == TCX_10_CORE ) ? NB_DIV : 1 ) ) ) +#else else if ( ( nrgRatio < 1.0f ) && ( k < ( ( core_l == TCX_20_CORE ) ? 1 : NB_DIV ) ) ) +#endif { v_multc( spec_l[k], 1.0f / nrgRatio, spec_l[k], L_frameTCX_l ); }