diff --git a/lib_com/options.h b/lib_com/options.h index 7b964312d28b59cc7dfe4a570f3a6e076c7aae6c..a135102855471597d33f5210c7ab4b27deb672a3 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -101,6 +101,7 @@ #define FIX_BASOP_2332_ASAN_OVERFLOW_IN_EXT_DIRAC_REND /* Nokia: basop issue 2332: Uses predefined memory sizes instead computing wrong */ #define FIX_BASOP_2333_MCMASA_ANA_MEMORY_LEAK /* Nokia: basop issue 2333: Add missing free for direction_vector_e to ivas_mcmasa_ana_fx.c */ #define HARM_COREDECODER_FUNCTIONS /* VA: basop issue 2347: Remove various duplicated code in core-decoder */ +#define FIX_BASOP_2358_SCALING_OOB /* Eri: Basip issue 2358: Clang-18 reports OOB access where scaling is applied to L_FRAME48k instead of output_frame */ #define FIX_BASOP_2351_EXTREND_SCALE /* FhG: basop issue 2351: Only scale initialized samples in renderer, related to 2326 */ #define FIX_2331_CLANG18_MSAN_UNINIT_VARIABLE /* FhG: Fix issue 2331: Uninitialized variable */ #define FIX_2362_TOTAL_BRATE_CALCULATION /* FhG: basop issue 2362: fix calculation of st->total_brate in ivas_cpe_enc_fx() */ diff --git a/lib_rend/ivas_objectRenderer_fx.c b/lib_rend/ivas_objectRenderer_fx.c index 9c76335e05a9b5a2e1f0452e277fc439a51685c4..8ba74dad89caaecf9beabdd21775217191aae495 100644 --- a/lib_rend/ivas_objectRenderer_fx.c +++ b/lib_rend/ivas_objectRenderer_fx.c @@ -434,9 +434,17 @@ ivas_error ivas_td_binaural_renderer_unwrap_fx( { Word16 i; +#ifdef FIX_BASOP_2358_SCALING_OOB + FOR( i = 0; i < num_src; ++i ) +#else FOR( i = 0; i < MAX_OUTPUT_CHANNELS; ++i ) +#endif { +#ifdef FIX_BASOP_2358_SCALING_OOB + scale_sig32( output_fx[i], output_frame, -4 ); // Q11 - 4 = Q7 +#else scale_sig32( output_fx[i], L_FRAME48k, -4 ); // Q11 - 4 = Q7 +#endif } IF( NE_32( ( error = ivas_reverb_process_fx( hReverb, transport_config, 0, output_fx, p_reverb_signal_fx, subframe_idx ) ), IVAS_ERR_OK ) ) // Q p_reverb_signal_fx = Q output_fx - 2 = 5 @@ -444,9 +452,17 @@ ivas_error ivas_td_binaural_renderer_unwrap_fx( return error; } +#ifdef FIX_BASOP_2358_SCALING_OOB + FOR( i = 0; i < num_src; ++i ) +#else FOR( i = 0; i < MAX_OUTPUT_CHANNELS; ++i ) +#endif { +#ifdef FIX_BASOP_2358_SCALING_OOB + scale_sig32( output_fx[i], output_frame, 4 ); // Q7 + 4 = Q11 +#else scale_sig32( output_fx[i], L_FRAME48k, 4 ); // Q7 + 4 = Q11 +#endif } FOR( i = 0; i < BINAURAL_CHANNELS; ++i )