Commit 6024e22a authored by malenov's avatar malenov
Browse files

re-insert assert() to catch situations when the ind_list[] buffer runs out of memory

parent adda5dd5
Loading
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -862,7 +862,12 @@ ivas_error check_ind_list_limits(
    if ( ( &hBstr->ind_list[hBstr->nb_ind_tot] - ivas_ind_list_zero ) >= *( hBstr->ivas_max_num_indices ) )
    {
#ifdef DEBUGGING
#ifdef DEBUG_IND_LIST_MEMORY
        /* TODO: replace with the warning message below before the finalization of the IVAS codec */
        assert( 0 && "The maximum number of indices has been exceeded! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata()." );
#else
        fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame );
#endif
#endif

        /* reallocate the buffer of indices with increased limit */
@@ -890,7 +895,12 @@ ivas_error check_ind_list_limits(
            if ( hBstr->ind_list >= ivas_ind_list_last )
            {
#ifdef DEBUGGING
#ifdef DEBUG_IND_LIST_MEMORY
                /* TODO: replace with the warning message below before the finalization of the IVAS codec */
                assert( 0 && "The maximum number of indices has been exceeded! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata()." );
#else
                fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame );
#endif
#endif

                /* no available empty slot -> need to re-allocate the buffer */
+1 −1
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@
#define DEBUG_JBM_CMD_OPTION                    /* ability for telling the decoder the frontend fetch size and to not delay compensate for bad frames at the beginning */

#define VARIABLE_SPEED_DECODING                 /* variable speed decoding employing the JBM functioniality; move to DEBUGGING after build for disabled is fixed */

#define DEBUG_IND_LIST_MEMORY                   /* raise assert() when ind_list[] runs out of memory */
#endif

/* #################### End DEBUGGING switches ############################ */