From 27dfb43c741933d4df905e5e4b88fe25827cc5ac Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 14 May 2024 08:49:38 +0200 Subject: [PATCH] add IVAS_ERRORS_FIX_GLOBAL_FRAME --- lib_com/bitstream.c | 16 ++++++++++++++++ lib_com/options.h | 1 + 2 files changed, 17 insertions(+) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index cff1f5b5e0..32e368e75c 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -884,7 +884,11 @@ ivas_error check_ind_list_limits( } else { +#ifdef IVAS_ERRORS_FIX_GLOBAL_FRAME + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Buffer of indices corrupted! Attempt to overwrite indice ID = %d (value: %d, bits: %d)!\n", hBstr->ind_list[hBstr->nb_ind_tot].id, hBstr->ind_list[hBstr->nb_ind_tot].value, hBstr->ind_list[hBstr->nb_ind_tot].nb_bits ); +#else return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Buffer of indices corrupted in frame %d! Attempt to overwrite indice ID = %d (value: %d, bits: %d)!\n", frame, hBstr->ind_list[hBstr->nb_ind_tot].id, hBstr->ind_list[hBstr->nb_ind_tot].value, hBstr->ind_list[hBstr->nb_ind_tot].nb_bits ); +#endif } } @@ -939,7 +943,11 @@ ivas_error push_indice( /* check the limits of the list of indices */ if ( ( error = check_ind_list_limits( hBstr ) ) != IVAS_ERR_OK ) { +#ifdef IVAS_ERRORS_FIX_GLOBAL_FRAME + return IVAS_ERROR( error, "Error occured in push_indice() while re-allocating the list of indices!\n" ); +#else return IVAS_ERROR( error, "Error occured in push_indice() while re-allocating the list of indices (frame %d) !\n", frame ); +#endif } /* find the location in the list of indices based on ID */ @@ -1095,7 +1103,11 @@ ivas_error push_next_bits( /* check the limits of the list of indices */ if ( ( error = check_ind_list_limits( hBstr ) ) != IVAS_ERR_OK ) { +#ifdef IVAS_ERRORS_FIX_GLOBAL_FRAME + return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices!\n" ); +#else return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n", frame ); +#endif } ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; @@ -1114,7 +1126,11 @@ ivas_error push_next_bits( /* check the limits of the list of indices */ if ( ( error = check_ind_list_limits( hBstr ) ) != IVAS_ERR_OK ) { +#ifdef IVAS_ERRORS_FIX_GLOBAL_FRAME + return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices!\n" ); +#else return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n", frame ); +#endif } ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; diff --git a/lib_com/options.h b/lib_com/options.h index cc4e5d249b..16a1767935 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -162,6 +162,7 @@ #define CONF_DISTATT /* Eri: Make distance attenuation configurable */ #define FIX_1082_INSTRUM_FAILED_LC3PLUS /* VoiceAge: issue 1082: fix ambiguous syntax in LC3Plus code leading to fails of instrumented builds */ #define FIX_1052_EXT_OUTPUT /* VA: issue 1052: define EXT decoder output configuration for stereo and MC formats */ +#define IVAS_ERRORS_FIX_GLOBAL_FRAME /* FhG: remove global variable from IVAS_ERROR calls in bitstream.c */ /* #################### End BE switches ################################## */ -- GitLab