From 8511028131618285fd2a19b8f2aad650cf27cd7c Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Tue, 2 Sep 2025 10:38:00 +0300 Subject: [PATCH 1/2] Fix reverb load sanitizer error in issue 1990 by introducing missing free. --- apps/decoder.c | 4 ++++ lib_com/options.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/apps/decoder.c b/apps/decoder.c index 320b30909..bfcd80007 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -734,6 +734,10 @@ cleanup: { destroy_SetOfHRTF( hSetOfHRTF ); } +#ifdef FIX_1990_SANITIZER_IN_REVERB_LOAD + IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ); + destroy_hrtf_statistics( hHrtfStatistics ); +#endif } IVAS_DEC_Close( &hIvasDec ); diff --git a/lib_com/options.h b/lib_com/options.h index 7e7cf6bdc..548b8feaa 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -83,6 +83,8 @@ #define FIX_1946_CRASH_JBM_PROCESSING /* FhG: Increased guard bits of DFT_fx */ #define FIX_1980_CRASH_FDCNG_ENCODESID /* FhG: Add one bit of headroom in e_fx calculation in FdCng_encodeSID_ivas_fx() */ #define FIX_1987_CRASH_OMASA_ENERGY /* FhG: Replace cldfbAnalysis_ts_fx_fix_q() with cldfbAnalysis_ts_fx_var_q() to avoid assertion error */ +#define FIX_1990_SANITIZER_IN_REVERB_LOAD /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure. */ + /* #################### Start BASOP porting switches ############################ */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ -- GitLab From f4a8bf1a1e7eed09f799a21d6ae763f354383b2d Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Tue, 2 Sep 2025 11:01:07 +0300 Subject: [PATCH 2/2] Adjust fix to cover also the second sanitizer case in issue 1990. --- apps/decoder.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index bfcd80007..efe6c5334 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -734,11 +734,14 @@ cleanup: { destroy_SetOfHRTF( hSetOfHRTF ); } + } + #ifdef FIX_1990_SANITIZER_IN_REVERB_LOAD - IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ); - destroy_hrtf_statistics( hHrtfStatistics ); + /* This free differs from float version and is done always. This should be safe to do even though we leave a return + * value as not handled. This is needed as HRTF statistics from ROM are currently converted from float values. */ + IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ); + destroy_hrtf_statistics( hHrtfStatistics ); #endif - } IVAS_DEC_Close( &hIvasDec ); CustomLsReader_close( &hLsCustomReader ); -- GitLab