Prevented SIGSEGVs when using -atip with my SCSI CD-ROM (sr,sg: no matter)

This commit is contained in:
Thomas Schmitt 2006-12-11 12:53:12 +00:00
parent 76cf98c90f
commit b9f04783a5
3 changed files with 12 additions and 4 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2006.12.11.115802"
#define Cdrskin_timestamP "2006.12.11.125222"

View File

@ -423,7 +423,9 @@ void mmc_read_toc(struct burn_drive *d)
}
}
if (tdata[3] < 100) {
if (tdata[0] <= 0 || tdata[0] > d->disc->sessions)
tdata[0] = d->disc->sessions;
if (tdata[3] < 100 && tdata[0] > 0) {
track = burn_track_create();
burn_session_add_track(d->disc->session[tdata[0] - 1],
track, BURN_POS_END);

View File

@ -386,13 +386,19 @@ int burn_disc_get_sectors(struct burn_disc *d)
void burn_track_get_entry(struct burn_track *t, struct burn_toc_entry *entry)
{
memcpy(entry, t->entry, sizeof(struct burn_toc_entry));
if (t->entry == NULL)
memset(entry, 0, sizeof(struct burn_toc_entry));
else
memcpy(entry, t->entry, sizeof(struct burn_toc_entry));
}
void burn_session_get_leadout_entry(struct burn_session *s,
struct burn_toc_entry *entry)
{
memcpy(entry, s->leadout_entry, sizeof(struct burn_toc_entry));
if (s->leadout_entry == NULL)
memset(entry, 0, sizeof(struct burn_toc_entry));
else
memcpy(entry, s->leadout_entry, sizeof(struct burn_toc_entry));
}
struct burn_session **burn_disc_get_sessions(struct burn_disc *d, int *num)