From 3f66a78eae569b520c3a07fb652d4b9570a22bd2 Mon Sep 17 00:00:00 2001 From: malenov Date: Tue, 14 May 2024 09:57:29 +0200 Subject: [PATCH 1/2] use global variable `frame` only under #ifdef DEBUGGING ... #endif --- lib_com/bitstream.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index cff1f5b5e0..41f5fc7ff4 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -884,7 +884,11 @@ ivas_error check_ind_list_limits( } else { +#ifdef DEBUGGING 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 ); +#else + 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 ); +#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 DEBUGGING return IVAS_ERROR( error, "Error occured in push_indice() while re-allocating the list of indices (frame %d) !\n", frame ); +#else + return IVAS_ERROR( error, "Error occured in push_indice() while re-allocating the list of indices!\n" ); +#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 DEBUGGING return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n", frame ); +#else + return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices!\n" ); +#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 DEBUGGING return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n", frame ); +#else + return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices!\n" ); +#endif } ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; -- GitLab From 371cdac42af5ba4f9029439e52a23d68b4b25222 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 15 May 2024 10:26:27 +0200 Subject: [PATCH 2/2] clang-format --- lib_com/bitstream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 41f5fc7ff4..47fbbb9db2 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -1107,7 +1107,7 @@ ivas_error push_next_bits( return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n", frame ); #else return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices!\n" ); -#endif +#endif } ptr = &hBstr->ind_list[hBstr->nb_ind_tot]; -- GitLab