Taken into account wrong nwa from buggy drives.

This commit is contained in:
Vreixo Formoso Lopes 2007-10-01 14:12:48 +00:00
parent f74f6abcc4
commit 5598861309

View File

@ -233,12 +233,19 @@ int isoburn_prepare_disc_aux(struct burn_drive *d, struct burn_disc **disc,
struct burn_track *track;
struct isoburn *o;
struct ecma119_source_opts wopts;
enum burn_disc_status state;
int ret;
ret= isoburn_find_emulator(&o, d, 0);
if(ret<0)
return -1;
state = isoburn_disc_get_status(drive);
if (state != BURN_DISC_BLANK && state != BURN_DISC_APPENDABLE) {
/* unsuitable status */
return -2;
}
wopts.volnum = 0;
wopts.level = opts->level;
wopts.flags = opts->flags;
@ -264,7 +271,12 @@ int isoburn_prepare_disc_aux(struct burn_drive *d, struct burn_disc **disc,
int lba, nwa;
ret = isoburn_disc_track_lba_nwa(d, NULL, 0, &lba, &nwa);
if (ret != 1)
return -2;
return -3;
if (nwa == 0 && state == BURN_DISC_APPENDABLE) {
/* invalid nwa */
return -4;
}
wopts.ms_block = nwa;
}