Made Xorriso__start_end_lbas() ready for long block adresses

This commit is contained in:
2024-03-21 17:52:51 +01:00
parent ec7ab520ba
commit 698bee2621
5 changed files with 27 additions and 29 deletions

View File

@ -2417,9 +2417,9 @@ int Xorriso_read_file_data(struct XorrisO *xorriso, IsoNode *node,
off_t img_offset, off_t disk_offset,
off_t bytes, int flag)
{
int ret, i, lba_count= 0, *start_lbas= NULL, *end_lbas= NULL, read_chunk= 16;
int ret, i, lba_count= 0, read_chunk= 16;
int quality, bad_extract= 0;
off_t lba, count, blocks, spot;
off_t lba, count, blocks, spot, *start_lbas= NULL, *end_lbas= NULL;
int data_to_skip= 0;
off_t indev_blocks;
off_t size= 0, file_base_bytes= 0, file_processed_bytes= 0, img_adr;
@ -2433,16 +2433,16 @@ int Xorriso_read_file_data(struct XorrisO *xorriso, IsoNode *node,
if(flag & 1) {
lba_count= 1;
Xorriso_alloc_meM(start_lbas, int, 1);
Xorriso_alloc_meM(end_lbas, int, 1);
Xorriso_alloc_meM(start_lbas, off_t, 1);
Xorriso_alloc_meM(end_lbas, off_t, 1);
Xorriso_alloc_meM(section_sizes, off_t, 1);
start_lbas[0]= 0;
ret= Xorriso_obtain_indev_readsize(xorriso, &indev_blocks, 0);
if(ret > 0 && indev_blocks <= 0x7ffffffe)
if(ret > 0)
end_lbas[0]= indev_blocks - 1;
else
end_lbas[0]= 0x7ffffffe;
size= ((off_t) end_lbas[0]) * 2048;
end_lbas[0]= 0x7ffffffffffffffe;
size= end_lbas[0] * (off_t) 2048;
section_sizes[0]= size;
} else {
ret= Xorriso__start_end_lbas(node, &lba_count, &start_lbas, &end_lbas,