From 66e50578f1a78564b3b4f70830fa1b3726b66388 Mon Sep 17 00:00:00 2001 From: naghibza Date: Fri, 31 Oct 2025 13:21:28 +0100 Subject: [PATCH] Reduce hStereoDft->q_smooth_buf_fx by one to prevent overflow in the subframe_band_nrg[][] calculation --- lib_com/options.h | 2 +- lib_dec/ivas_stereo_dft_dec_fx.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 0f0fb78dc..2eb595739 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -87,7 +87,7 @@ #define FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE /* FhG: Use dynamic Q factor for synth_fx and synthFB_fx to prevent overflow */ #define FIX_2082_FP_LEFTOVERS_OMASA_DEC /* Nokia: fix for issue 2082, cleaning remaining floating point code */ - +#define FIX_2176_ASSERT_DEC_MAP_PARAMS_DIRAC2STEREO /* FhG: Reduce hStereoDft->q_smooth_buf_fx by one to prevent overflow in the subframe_band_nrg[][] calculation */ /* ################### End FIXES switches ########################### */ /* #################### Start BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_stereo_dft_dec_fx.c b/lib_dec/ivas_stereo_dft_dec_fx.c index aa8d428c7..186306209 100644 --- a/lib_dec/ivas_stereo_dft_dec_fx.c +++ b/lib_dec/ivas_stereo_dft_dec_fx.c @@ -220,7 +220,11 @@ void stereo_dft_dec_reset_fx( { set32_fx( hStereoDft->smooth_buf_fx[i], 0, SBA_DIRAC_NRG_SMOOTH_LONG + 1 ); } +#ifdef FIX_2176_ASSERT_DEC_MAP_PARAMS_DIRAC2STEREO + hStereoDft->q_smooth_buf_fx = Q6; +#else hStereoDft->q_smooth_buf_fx = Q7; +#endif move16(); set16_fx( hStereoDft->smooth_fac_fx[0], 0, SBA_DIRAC_STEREO_NUM_BANDS ); set16_fx( hStereoDft->smooth_fac_fx[1], 0, SBA_DIRAC_STEREO_NUM_BANDS ); -- GitLab