Keeping -check_media from reading outside of medium readable area
This commit is contained in:
parent
61377f6caf
commit
dcf0a34920
@ -2872,7 +2872,8 @@ int Xorriso_check_media(struct XorrisO *xorriso, struct SpotlisT **spotlist,
|
|||||||
int blocks, os_errno, i, j, last_track_end= -1, track_blocks, track_lba;
|
int blocks, os_errno, i, j, last_track_end= -1, track_blocks, track_lba;
|
||||||
int num_sessions, num_tracks, declare_untested= 0, md5_start;
|
int num_sessions, num_tracks, declare_untested= 0, md5_start;
|
||||||
int read_capacity= -1, end_lba, hret, count, quality, profile_no;
|
int read_capacity= -1, end_lba, hret, count, quality, profile_no;
|
||||||
char *toc_info= NULL, profile_name[80];
|
int track_bad_claim= 0;
|
||||||
|
char *toc_info= NULL, profile_name[80], msg[160];
|
||||||
struct burn_drive *drive;
|
struct burn_drive *drive;
|
||||||
struct burn_drive_info *dinfo;
|
struct burn_drive_info *dinfo;
|
||||||
enum burn_disc_status s;
|
enum burn_disc_status s;
|
||||||
@ -2974,7 +2975,21 @@ int Xorriso_check_media(struct XorrisO *xorriso, struct SpotlisT **spotlist,
|
|||||||
track_lba + track_blocks < read_capacity + 32 &&
|
track_lba + track_blocks < read_capacity + 32 &&
|
||||||
(profile_no == 0x41 || profile_no == 0x40)))
|
(profile_no == 0x41 || profile_no == 0x40)))
|
||||||
track_blocks= read_capacity - track_lba;
|
track_blocks= read_capacity - track_lba;
|
||||||
|
if(track_lba + track_blocks > read_capacity) {
|
||||||
|
if(track_bad_claim < track_lba + track_blocks)
|
||||||
|
track_bad_claim= track_lba + track_blocks;
|
||||||
|
if(track_lba >= read_capacity) {
|
||||||
|
sprintf(msg, "-check_media: Track %d of session %d begins after end of readable medium area.",
|
||||||
|
j + 1, i + 1);
|
||||||
|
Xorriso_msgs_submit(xorriso, 0, msg, 0, "WARNING", 0);
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
sprintf(msg, "-check_media: Track %d of session %d extends over the end of readable medium area.",
|
||||||
|
j + 1, i + 1);
|
||||||
|
Xorriso_msgs_submit(xorriso, 0, msg, 0, "WARNING", 0);
|
||||||
|
track_blocks= read_capacity - track_lba;
|
||||||
|
}
|
||||||
|
}
|
||||||
md5_start= track_lba;
|
md5_start= track_lba;
|
||||||
if(i == 0 && j == 0) {
|
if(i == 0 && j == 0) {
|
||||||
if(track_lba == 32) {
|
if(track_lba == 32) {
|
||||||
@ -3021,6 +3036,14 @@ int Xorriso_check_media(struct XorrisO *xorriso, struct SpotlisT **spotlist,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(track_bad_claim > read_capacity) {
|
||||||
|
ret= Spotlist_add_item(*spotlist, read_capacity,
|
||||||
|
track_bad_claim - read_capacity,
|
||||||
|
Xorriso_read_quality_unreadablE, 0);
|
||||||
|
if(ret <= 0)
|
||||||
|
goto ex;
|
||||||
|
}
|
||||||
|
|
||||||
} else if(mode == 1) { /* Image range */
|
} else if(mode == 1) { /* Image range */
|
||||||
/* Default is the emulated disc capacity.
|
/* Default is the emulated disc capacity.
|
||||||
*/
|
*/
|
||||||
|
@ -1 +1 @@
|
|||||||
#define Xorriso_timestamP "2013.08.27.095314"
|
#define Xorriso_timestamP "2013.09.05.080255"
|
||||||
|
Loading…
Reference in New Issue
Block a user