From f59a77898b01f4f59a2f7d4936d1df451b3f450a Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Wed, 24 May 2023 12:27:47 +0200 Subject: [PATCH] decrement the last index of the for loop to avoid ASAN error --- lib_com/options.h | 1 + lib_enc/ivas_qmetadata_enc.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 0a9e37c191..c9bc2c9077 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -205,6 +205,7 @@ #define FIX_468_16KHZ_PUPMIX /* Dlb: Fix issue 468 for Param Upmix at 16kHz sampling rate */ #define FIX_485_STATIC_BUFFERS /* FhG: move static buffers in DirAC parameter estimator to the DirAC struct */ +#define FIX_I503_ASAN_ERROR_IND_LIST /* VA: fix issue #503: address sanitizer error with IND_LIST_DYN */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 40d5bff892..3bbf084a7e 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -2222,7 +2222,11 @@ void restore_metadata_buffer( int16_t i; #ifdef IND_LIST_DYN +#ifdef FIX_I503_ASAN_ERROR_IND_LIST + for ( i = next_ind_start; i < hMetaData->nb_ind_tot; i++ ) +#else for ( i = next_ind_start; i <= hMetaData->nb_ind_tot; i++ ) +#endif #else for ( i = next_ind_start; i <= hMetaData->next_ind; i++ ) #endif -- GitLab