From 736a549785d280dd579b9952d29b5b01b9fd7290 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 23 Feb 2026 15:47:47 +0100 Subject: [PATCH 1/2] check for NULL pointer before accessing memories in proto_power_diff_smooth_prev_fx --- lib_com/options.h | 2 +- lib_rend/ivas_dirac_rend_fx.c | 43 +++++++++++++++++++++++------------ 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 439a9e508..923bee940 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -104,7 +104,7 @@ #define NONBE_MR2809 #define FIX_2432_ISM_SPIKES_16KHZ /* VA: basop issue 2432: fix spikes in ISM decoding at 16kHz output sampling rate */ - +#define FIX_2448_RENDERER_MSAN_ERROR /* FhG: basop issue 2448: fix MSAN error with MSA rendering */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_rend/ivas_dirac_rend_fx.c b/lib_rend/ivas_dirac_rend_fx.c index cbd31bd13..c5f3bf3c5 100644 --- a/lib_rend/ivas_dirac_rend_fx.c +++ b/lib_rend/ivas_dirac_rend_fx.c @@ -4278,22 +4278,37 @@ static void ivas_masa_ext_dirac_render_sf_fx( hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_prev_q[1] = s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_q[1], hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_prev_q[1] ); move16(); - Word16 proto_power_diff_smooth_prev_temp_q = getScaleFactor32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_len ); - Scale_sig32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_len, proto_power_diff_smooth_prev_temp_q ); // hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q + proto_power_diff_smooth_prev_temp_q - hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q = add( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q, proto_power_diff_smooth_prev_temp_q ); - move16(); +#ifdef FIX_2448_RENDERER_MSAN_ERROR + IF ( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx ) +#endif + { + Word16 proto_power_diff_smooth_prev_temp_q = getScaleFactor32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_len ); + Scale_sig32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_len, proto_power_diff_smooth_prev_temp_q ); // hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q + proto_power_diff_smooth_prev_temp_q + hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q = add( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q, proto_power_diff_smooth_prev_temp_q ); + move16(); + } - Word16 proto_power_diff_smooth_temp_q = getScaleFactor32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_len ); - Scale_sig32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_len, proto_power_diff_smooth_temp_q ); // hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q + proto_power_diff_smooth_temp_q - hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q = add( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, proto_power_diff_smooth_temp_q ); - move16(); +#ifdef FIX_2448_RENDERER_MSAN_ERROR + IF ( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx ) +#endif + { + Word16 proto_power_diff_smooth_temp_q = getScaleFactor32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_len ); + Scale_sig32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_len, proto_power_diff_smooth_temp_q ); // hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q + proto_power_diff_smooth_temp_q + hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q = add( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, proto_power_diff_smooth_temp_q ); + move16(); + } - Scale_sig32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_len, sub( s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q ), hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q ) ); // s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q ) - Scale_sig32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_len, sub( s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q ), hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q ) ); // s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q ) - hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q = s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q ); - move16(); - hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q = s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q ); - move16(); +#ifdef FIX_2448_RENDERER_MSAN_ERROR + IF ( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx ) +#endif + { + Scale_sig32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_len, sub( s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q ), hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q ) ); // s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q ) + Scale_sig32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_len, sub( s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q ), hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q ) ); // s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q ) + hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q = s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q ); + move16(); + hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q = s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q ); + move16(); + } Scale_sig32( diffuseness_vector_fx, hSpatParamRendCom->num_freq_bands, 1 ); -- GitLab From 0cd63fa8a6f23b3c98020c7fcec2a3ba552c61d7 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 23 Feb 2026 15:52:57 +0100 Subject: [PATCH 2/2] fix formating --- lib_rend/ivas_dirac_rend_fx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_rend/ivas_dirac_rend_fx.c b/lib_rend/ivas_dirac_rend_fx.c index c5f3bf3c5..bbee68c9e 100644 --- a/lib_rend/ivas_dirac_rend_fx.c +++ b/lib_rend/ivas_dirac_rend_fx.c @@ -4279,7 +4279,7 @@ static void ivas_masa_ext_dirac_render_sf_fx( move16(); #ifdef FIX_2448_RENDERER_MSAN_ERROR - IF ( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx ) + IF( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx ) #endif { Word16 proto_power_diff_smooth_prev_temp_q = getScaleFactor32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_len ); @@ -4289,7 +4289,7 @@ static void ivas_masa_ext_dirac_render_sf_fx( } #ifdef FIX_2448_RENDERER_MSAN_ERROR - IF ( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx ) + IF( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx ) #endif { Word16 proto_power_diff_smooth_temp_q = getScaleFactor32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_len ); @@ -4299,7 +4299,7 @@ static void ivas_masa_ext_dirac_render_sf_fx( } #ifdef FIX_2448_RENDERER_MSAN_ERROR - IF ( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx ) + IF( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx ) #endif { Scale_sig32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_len, sub( s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q ), hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q ) ); // s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q ) -- GitLab