Commit ecbf511c authored by malenov's avatar malenov
Browse files

insert assert() message to catch siatuations when ind_list[] runs out of...

insert assert() message to catch siatuations when ind_list[] runs out of memory -> must be replaced with a warning message before the finalization of the IVAS codec
parent 3bd6cbc4
Loading
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -921,7 +921,9 @@ 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
        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 );
        /* TODO: replace with the warning message below before the finalization of the IVAS codec */
        /* 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 ); */
        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()." );
#endif

        /* reallocate the buffer of indices with increased limit */
@@ -946,7 +948,9 @@ ivas_error check_ind_list_limits(
            if ( hBstr->ind_list >= ivas_ind_list_last )
            {
#ifdef DEBUGGING
                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 );
                /* TODO: replace with the warning message below before the finalization of the IVAS codec */
                /* 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 ); */
                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()." );
#endif

                /* no available empty slot -> need to re-allocate the buffer */