Made clear that a drive needs an isoburn object for writing. Coverity CID 28758.

This commit is contained in:
Thomas Schmitt 2015-11-03 15:41:47 +00:00
parent b8c2eb2e6c
commit 9664b1fabf
2 changed files with 37 additions and 32 deletions

View File

@ -920,40 +920,45 @@ void isoburn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
ret= isoburn_find_emulator(&o, drive, 0); ret= isoburn_find_emulator(&o, drive, 0);
if(ret<0) if(ret<0)
goto ex; goto ex;
if(o!=NULL) { if(o == NULL) {
o->wrote_well= -1; sprintf(msg,
if(o->emulation_mode!=0) { "Program error: Cannot find isoburn object associated to the drive");
burn_write_opts_set_multi(opts, 0); isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0);
if(o->emulation_mode>0 && o->nwa >= 0) { burn_drive_cancel(drive);
nwa= o->nwa; goto ex;
}
o->wrote_well= -1;
if(o->emulation_mode!=0) {
burn_write_opts_set_multi(opts, 0);
if(o->emulation_mode>0 && o->nwa >= 0) {
nwa= o->nwa;
/* This caters for unwritten formatted DVD-RW. They need to be written /* This caters for unwritten formatted DVD-RW. They need to be written
sequentially on the first use. Only written areas are random access. sequentially on the first use. Only written areas are random access.
If the first session is not written to LBA 0, then re-opening of If the first session is not written to LBA 0, then re-opening of
formatting and padding is needed. formatting and padding is needed.
This can be done. But when the track gets closed after padding, This can be done. But when the track gets closed after padding,
this lasts a long time. There is a high risk that an app will not this lasts a long time. There is a high risk that an app will not
poll the message queue while waiting for isoburn_disc_write() to poll the message queue while waiting for isoburn_disc_write() to
return. The pacifier loop usually happens only afterwards. return. The pacifier loop usually happens only afterwards.
So automatic formatting might cause a nervous clueless user. So automatic formatting might cause a nervous clueless user.
*/
ret= isoburn_is_intermediate_dvd_rw(drive, 0);
if(ret>0 && nwa>0 && nwa <= o->zero_nwa) {
/* actually this should not happen since such media get recognized
by isoburn_welcome_media and o->zero_nwa gets set to 0
*/ */
ret= isoburn_is_intermediate_dvd_rw(drive, 0); sprintf(msg,
if(ret>0 && nwa>0 && nwa <= o->zero_nwa) { "DVD-RW insufficiently formatted. (Intermediate State, size unknown)");
/* actually this should not happen since such media get recognized isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0);
by isoburn_welcome_media and o->zero_nwa gets set to 0 sprintf(msg,
*/ "It might help to first deformat it and then format it again");
sprintf(msg, isoburn_msgs_submit(o, 0x00060000, msg, 0, "HINT", 0);
"DVD-RW insufficiently formatted. (Intermediate State, size unknown)"); burn_drive_cancel(drive); /* mark run as failure */
isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0); goto ex;
sprintf(msg,
"It might help to first deformat it and then format it again");
isoburn_msgs_submit(o, 0x00060000, msg, 0, "HINT", 0);
burn_drive_cancel(drive); /* mark run as failure */
goto ex;
}
/* end of DVD-RW oriented check */
burn_write_opts_set_start_byte(opts, nwa * (off_t) 2048);
} }
/* end of DVD-RW oriented check */
burn_write_opts_set_start_byte(opts, nwa * (off_t) 2048);
} }
} }

View File

@ -1 +1 @@
#define Xorriso_timestamP "2015.11.03.150839" #define Xorriso_timestamP "2015.11.03.154102"