From 2f548e046d0a9615da9170e1eccecf8f908a2be7 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 18 Jan 2012 12:04:30 +0000 Subject: [PATCH] Detecting address sequence errors with .cue command INDEX --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/structure.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index f9ef512..8196e5b 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2012.01.16.112258" +#define Cdrskin_timestamP "2012.01.18.120429" diff --git a/libburn/structure.c b/libburn/structure.c index 9c25335..01c81fc 100644 --- a/libburn/structure.c +++ b/libburn/structure.c @@ -1129,6 +1129,7 @@ struct burn_cue_file_cursor { int start_track_no; struct burn_source *offst_source; int current_file_ba; + int current_index_ba; struct burn_track *prev_track; int prev_file_ba; int prev_block_size; @@ -1161,6 +1162,7 @@ static int cue_crs_new(struct burn_cue_file_cursor **reply, int flag) crs->start_track_no = 1; crs->offst_source = NULL; crs->current_file_ba = -1000000000; + crs->current_index_ba = -1000000000; crs->prev_track = NULL; crs->prev_file_ba = -1000000000; crs->prev_block_size = 0; @@ -1316,6 +1318,7 @@ static int cue_attach_track(struct burn_session *session, crs->track_current_index = -1; crs->track_has_source = 0; crs->current_file_ba = -1; + crs->current_index_ba = -1; if (!crs->block_size_locked) crs->block_size = 0; return 1; @@ -1715,7 +1718,8 @@ overlapping_ba:; 0, 0); ret = 0; goto ex; } - + if (file_ba < crs->current_index_ba) + goto overlapping_ba; if (crs->prev_track != NULL && crs->track_current_index < 0) { size = (file_ba - crs->prev_file_ba) * crs->prev_block_size; @@ -1727,7 +1731,7 @@ overlapping_ba:; !(crs->track_current_index < 0 && index_no <= 1)) { libdax_msgs_submit(libdax_messenger, -1, 0x00020192, LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH, - "Backward INDEX number in cue sheet file", + "Unacceptable INDEX number in cue sheet file", 0, 0); ret = 0; goto ex; } @@ -1735,6 +1739,7 @@ overlapping_ba:; if (crs->current_file_ba < 0) crs->current_file_ba = file_ba; + crs->current_index_ba = file_ba; /* Set index address relative to track source start */ ret = burn_track_set_index(crs->track, index_no,