From 2846e2b1611c1bb9dcffb7c774492b81f5f6dbb0 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 23 Oct 2023 16:15:58 +0200 Subject: [PATCH 1/2] avoid arithmetic with NULL pointer in DirAC decoder --- lib_com/options.h | 1 + lib_dec/ivas_dirac_dec.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 9de0874dbb..dd13856281 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,6 +154,7 @@ #define FIX_814_DOUBLE_PREC_IN_REVERB /* Philips: Issue 814: Replace double precision arithmetic in reverb */ #define FIX_866_MOVE_VBAP /* Nokia: Issue 866: Move VBAP to lib_rend */ #define FIX_863_REMOVE_REDUNDANCIES_OMASA /* Nokia/VA: Issue 863: Remove redundancies in stereo_classifier for OMASA */ +#define FIX_879_USAN_ERROR_IN_MASA_DECODING /* FhG: Issue 879 : avoid arithmetic with NULL pointer in the DirAC decoder to fix USAN error */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 876ae9130d..815422a182 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1812,7 +1812,11 @@ void ivas_dirac_dec_render_sf( DirAC_mem = hDirACRend->stack_mem; reference_power = DirAC_mem.reference_power; +#ifdef FIX_879_USAN_ERROR_IN_MASA_DECODING + reference_power_smooth = ( DirAC_mem.reference_power == NULL ) ? NULL : DirAC_mem.reference_power + hSpatParamRendCom->num_freq_bands; +#else reference_power_smooth = DirAC_mem.reference_power + hSpatParamRendCom->num_freq_bands; +#endif onset_filter = DirAC_mem.onset_filter; onset_filter_subframe = ( DirAC_mem.onset_filter == NULL ) ? NULL : DirAC_mem.onset_filter + hSpatParamRendCom->num_freq_bands; -- GitLab From b4aba85f387b9667efd237bb9e83b8016f8f2b25 Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 23 Oct 2023 16:27:06 +0200 Subject: [PATCH 2/2] remove entry from usan suppression file --- scripts/ubsan.supp | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ubsan.supp b/scripts/ubsan.supp index f33ddee9d4..fc3f22e328 100644 --- a/scripts/ubsan.supp +++ b/scripts/ubsan.supp @@ -34,7 +34,6 @@ implicit-signed-integer-truncation:pvq_core_dec.c implicit-signed-integer-truncation:pvq_core_enc.c implicit-signed-integer-truncation:tcq_position_arith.c implicit-signed-integer-truncation:tools.c -pointer-overflow:ivas_dirac_dec.c shift-base:basop32.c shift-base:enh40.c shift-base:enh40.h -- GitLab