diff --git a/lib_com/options.h b/lib_com/options.h index 1f0645be921d9b89cd8825fe1364df01c4d4d2cf..2f28b8ccb330dece097261506063f6675e1beb0a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,6 +164,7 @@ #define FIX_RAM_COUNTING_5MS_RENDERING /* FhG: fix for correct RAM reporting with 5ms rendering */ #define FIX_786_ERROR_ISM_METADATA_READ /* VA: fix error reading past the last line of .csv metadata files */ +#define FIX_632_USAN_ERROR_NULL_POINTER /* FhG: issue 632 USAN offset to null pointer proto_diffuse_buffer_f in dirac rendering*/ /* #################### End BE switches ################################## */ /* #################### Start NON-BE switches ############################ */ diff --git a/lib_rend/ivas_dirac_output_synthesis_dec.c b/lib_rend/ivas_dirac_output_synthesis_dec.c index 7c73d0fc9e4abd006873290e9d7c51dd137b7ea2..568341abe1b54d815190e78f00d17a224a856616 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec.c @@ -1522,7 +1522,12 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls( } /*Diffuse stream*/ - p_power_smooth_diff = h_dirac_output_synthesis_state->proto_diffuse_buffer_f + buf_idx * 2 * h_dirac_output_synthesis_params->max_band_decorr * nchan_out_woLFE; +#ifdef FIX_632_USAN_ERROR_NULL_POINTER + if ( h_dirac_output_synthesis_params->max_band_decorr != 0 ) +#endif + { + p_power_smooth_diff = h_dirac_output_synthesis_state->proto_diffuse_buffer_f + buf_idx * 2 * h_dirac_output_synthesis_params->max_band_decorr * nchan_out_woLFE; + } p_gain_1 = gains_diff; p_gain_2 = h_dirac_output_synthesis_state->gains_diff_prev; for ( k = 0; k < nchan_out_woLFE; k++ ) diff --git a/lib_rend/ivas_dirac_rend.c b/lib_rend/ivas_dirac_rend.c index 326930e0db35299781f9104cc38bdc2e79147bf0..5739bc71e6f6bc219eca9277675c52be60a61830 100644 --- a/lib_rend/ivas_dirac_rend.c +++ b/lib_rend/ivas_dirac_rend.c @@ -1641,6 +1641,12 @@ void ivas_dirac_dec_compute_diffuse_proto( h_dirac_output_synthesis_state = &( hDirACRend->h_output_synthesis_psd_state ); num_freq_bands_diff = h_dirac_output_synthesis_params->max_band_decorr; +#ifdef FIX_632_USAN_ERROR_NULL_POINTER + if ( num_freq_bands_diff == 0 ) + { + return; + } +#endif p_diff_buffer = h_dirac_output_synthesis_state->proto_diffuse_buffer_f + slot_idx * 2 * num_freq_bands_diff * hDirACRend->hOutSetup.nchan_out_woLFE; p_diff_buffer_1 = p_diff_buffer + 1; diff --git a/scripts/ubsan.supp b/scripts/ubsan.supp index 0e32af3ae1b21efb3b8e98b0cc176874847122fc..f5fba87eda20ec7cb0b77e505d8b3ed0f6af92f1 100644 --- a/scripts/ubsan.supp +++ b/scripts/ubsan.supp @@ -38,8 +38,6 @@ implicit-signed-integer-truncation:tcq_position_arith.c implicit-signed-integer-truncation:tools.c null:ivas_dirac_com.c pointer-overflow:ivas_dirac_dec.c -pointer-overflow:ivas_dirac_output_synthesis_dec.c -pointer-overflow:ivas_dirac_rend.c shift-base:basop32.c shift-base:enh40.c shift-base:enh40.h