Made Xorriso__file_start_lba() ready for long block adresses

This commit is contained in:
2024-03-21 19:28:34 +01:00
parent 698bee2621
commit 2d3302db51
9 changed files with 32 additions and 23 deletions

View File

@ -402,8 +402,9 @@ int Xorriso_set_system_area(struct XorrisO *xorriso,
struct isoburn_imgen_opts *sopts,
int flag)
{
int ret, options, system_area_options, iso_lba= -1, start_lba, image_blocks;
int ret, options, system_area_options, start_lba, image_blocks;
int sa_loaded, read_count, i, read_sum= 0;
off_t iso_lba= -1;
char volid[33];
FILE *fp= NULL;
char *buf= NULL, *bufpt= NULL, *intvl;
@ -478,13 +479,13 @@ int Xorriso_set_system_area(struct XorrisO *xorriso,
if(ret > 0)
iso_lba= start_lba + image_blocks;
}
if(((off_t) iso_lba) * (off_t) 4 > hd_lba) {
if(iso_lba * (off_t) 4 > hd_lba) {
system_area_options= 0;
} else if((xorriso->patch_system_area & 1) &&
((off_t) iso_lba) * (off_t) 4 != hd_lba) {
iso_lba * (off_t) 4 != hd_lba) {
system_area_options= 0;
} else if((xorriso->patch_system_area & 2) &&
((off_t) iso_lba) * (off_t) 4 + (off_t) (63 * 256) < hd_lba) {
iso_lba * (off_t) 4 + (off_t) (63 * 256) < hd_lba) {
system_area_options= 0;
} else if(xorriso->patch_system_area & 2) { /* isohybrid patching */
/* Check whether bytes 432-345 point to ElTorito LBA */
@ -495,7 +496,7 @@ int Xorriso_set_system_area(struct XorrisO *xorriso,
system_area_options= 0;
} else if(bootimg_node != NULL) {
Xorriso__file_start_lba((IsoNode *) bootimg_node, &(iso_lba), 0);
if(((off_t) iso_lba) * (off_t) 4 != hd_lba)
if(iso_lba * (off_t) 4 != hd_lba)
system_area_options= 0;
}
}