diff --git a/xorriso/write_run.c b/xorriso/write_run.c index c356f273..f8428b3b 100644 --- a/xorriso/write_run.c +++ b/xorriso/write_run.c @@ -3495,8 +3495,9 @@ ex:; int Xorriso_adjust_session_size(struct XorrisO *xorriso, struct burn_drive *drive, char *head_buffer, - int iso_lba, int iso_size, - int checksum_block, int session_size, int flag) + off_t iso_lba, off_t iso_size, + int checksum_block, off_t session_size, + int flag) { int i, ret, tag_type; uint32_t pos, range_start, range_size, next_tag; @@ -3540,6 +3541,11 @@ no_ctx:; /* Update session PVD at iso_lba+16 to iso_size */ headpt= head_buffer + 32 * 1024; + if(iso_size > (off_t) 0xffffffff) { + sprintf(xorriso->info_text, "The total ISO filesystem size exceeds 8 TiB"); + Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); + ret= 0; goto ex; + } for(i= 0; i < 4; i++) headpt[87 - i]= headpt[80 + i]= (iso_size >> (8 * i)) & 0xff; @@ -3548,7 +3554,7 @@ no_ctx:; ret= iso_md5_compute(ctx_chng, head_buffer + 32768, 2048); if(ret <= 0) goto ex; - ret= Xorriso_migrate_checksum_tag(xorriso, head_buffer, iso_lba, 17, + ret= Xorriso_migrate_checksum_tag(xorriso, head_buffer, (int) iso_lba, 17, checksum_block, md5_rec, ctx_unch, ctx_chng, 0); if(ret == -2) @@ -3563,15 +3569,14 @@ no_ctx:; } } - ret= Xorriso_overwrite_iso_head(xorriso, drive, head_buffer, (off_t) iso_lba, - 0); + ret= Xorriso_overwrite_iso_head(xorriso, drive, head_buffer, iso_lba, 0); if(ret <= 0) goto ex; if(checksum_block > 0) { /* Verify and re-compute existing checksum tree and session tag */ ret= Xorriso_refresh_ts_tags(xorriso, drive, ctx_unch, ctx_chng, - (off_t) iso_lba, (off_t) session_size, checksum_block, 0); + iso_lba, session_size, checksum_block, 0); if(ret == -2) goto no_ctx; if(ret <= 0) @@ -3793,8 +3798,8 @@ wrong_adjust:; if(iso_size != new_size) { ret=Xorriso_adjust_session_size(xorriso, drive, head_buffer, - (int) iso_lba, (int) iso_size, - checksum_block, (int) new_size, 0); + iso_lba, iso_size, + checksum_block, new_size, 0); if(ret <= 0) goto ex; } diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 22932975..d104b65e 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2024.03.23.174931" +#define Xorriso_timestamP "2024.03.23.183351"