From 5f6e64b792f48183775206682126d2a9541cf799 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 25 Apr 2015 12:13:11 +0200 Subject: [PATCH] Bug fix: GPT production did not yield proper results with appended sessions resp. with TOC emulation enabled. --- libisofs/system_area.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libisofs/system_area.c b/libisofs/system_area.c index 4fbad2c..cd12f79 100644 --- a/libisofs/system_area.c +++ b/libisofs/system_area.c @@ -1768,7 +1768,7 @@ int iso_write_system_area(Ecma119Image *t, uint8_t *buf) return ISO_NON_MBR_SYS_AREA; if (t->gpt_backup_outside) - gpt_blocks = t->total_size / 2048; + gpt_blocks = t->total_size / BLOCK_SIZE + t->opts->ms_block; else gpt_blocks = img_blocks; ret = iso_write_gpt(t, gpt_blocks, buf); @@ -1879,7 +1879,7 @@ int iso_write_system_area(Ecma119Image *t, uint8_t *buf) */ img_blocks = t->curblock; /* value might be altered */ if (part_type == 0xee) { - mbrp1_blocks = t->total_size / 2048; + mbrp1_blocks = t->total_size / BLOCK_SIZE + t->opts->ms_block; offset_flag |= 2 | 1; /* protective MBR, no other partitions */ } else { mbrp1_blocks = img_blocks; @@ -2448,7 +2448,7 @@ int gpt_tail_writer_compute_data_blocks(IsoImageWriter *writer) if (t->gpt_backup_outside) { t->total_size += t->gpt_backup_size * 2048; /* The ISO block number after the backup GPT header */ - t->gpt_backup_end = t->total_size / 2048; + t->gpt_backup_end = t->total_size / BLOCK_SIZE + t->opts->ms_block; } else { t->curblock += t->gpt_backup_size; /* The ISO block number after the backup GPT header */