The VCD specification requests that timestamps will strictly increase as
one advances through the file. Add another check where the previous
implementation resulted in a tight loop and made the application stall.
Do print an error message and abort file processing in that case.
This fixes bug #1250.
inc->prev_timestamp = inc->skip;
} else if (timestamp == inc->prev_timestamp) {
/* Ignore repeated timestamps (e.g. sigrok outputs these) */
+ } else if (timestamp < inc->prev_timestamp) {
+ sr_err("Invalid timestamp: %" PRIu64 " (smaller than previous timestamp).", timestamp);
+ inc->skip_until_end = TRUE;
+ break;
} else {
if (inc->compress != 0 && timestamp - inc->prev_timestamp > inc->compress) {
/* Compress long idle periods */