From a836b4e8e3a7f30a3ec7986561c3b527f4f516ed Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Tue, 18 Jul 2023 16:03:55 +0200 Subject: [PATCH] fix issue 613 by moving hSpar member access under guardian condition. switch FIX_613_DIRAC_NULL_PTR_USAN --- lib_com/ivas_dirac_com.c | 16 ++++++++++++++++ lib_com/options.h | 1 + 2 files changed, 17 insertions(+) diff --git a/lib_com/ivas_dirac_com.c b/lib_com/ivas_dirac_com.c index 20f4b24953..504aea5d6c 100644 --- a/lib_com/ivas_dirac_com.c +++ b/lib_com/ivas_dirac_com.c @@ -111,12 +111,20 @@ ivas_error ivas_dirac_config( if ( ( (Encoder_Struct *) st_ivas )->hSpar != NULL ) { hFbMdft = ( (Encoder_Struct *) st_ivas )->hSpar->hFbMixer; +#ifdef FIX_613_DIRAC_NULL_PTR_USAN + dirac_to_spar_md_bands = ( (Encoder_Struct *) st_ivas )->hSpar->dirac_to_spar_md_bands; +#endif } else { hFbMdft = NULL; +#ifdef FIX_613_DIRAC_NULL_PTR_USAN + dirac_to_spar_md_bands = NULL; +#endif } +#ifndef FIX_613_DIRAC_NULL_PTR_USAN dirac_to_spar_md_bands = ( (Encoder_Struct *) st_ivas )->hSpar->dirac_to_spar_md_bands; +#endif } else { @@ -131,13 +139,21 @@ ivas_error ivas_dirac_config( if ( ( (Decoder_Struct *) st_ivas )->hSpar != NULL ) { hFbMdft = ( (Decoder_Struct *) st_ivas )->hSpar->hFbMixer; +#ifdef FIX_613_DIRAC_NULL_PTR_USAN + dirac_to_spar_md_bands = ( (Decoder_Struct *) st_ivas )->hSpar->dirac_to_spar_md_bands; +#endif } else { hFbMdft = NULL; +#ifdef FIX_613_DIRAC_NULL_PTR_USAN + dirac_to_spar_md_bands = NULL; +#endif } ( (Decoder_Struct *) st_ivas )->hDirAC->hFbMdft = hFbMdft; +#ifndef FIX_613_DIRAC_NULL_PTR_USAN dirac_to_spar_md_bands = ( (Decoder_Struct *) st_ivas )->hSpar->dirac_to_spar_md_bands; +#endif } if ( ivas_format == SBA_FORMAT ) diff --git a/lib_com/options.h b/lib_com/options.h index 57154a5247..df23d4fa6a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -174,6 +174,7 @@ #define FIX_MEM_REALLOC_IND_LIST /* VA: issue 601: failure of the automatic memory re-allocation mechanism when ind_list[] buffer is depleted in MASA mode with 2 TC*/ #define FIX_581_CLANG_OFFSET_TO_NULL /* FhG: issue 581: fix CLANG error about applying an offset to a NULL pointer */ #define JBM_PARAMUPMIX /* Dlb: Issue 471: Integrate the Multichannel Parametric Upmix into the JBM path */ +#define FIX_613_DIRAC_NULL_PTR_USAN /* Nokia: Issue #613: USAN in DirAC decoder setup */ /* ################## End BE DEVELOPMENT switches ######################### */ -- GitLab