diff --git a/include/aaruformat/context.h b/include/aaruformat/context.h index b7471c2..6336446 100644 --- a/include/aaruformat/context.h +++ b/include/aaruformat/context.h @@ -140,7 +140,7 @@ typedef struct TapePartitionHashEntry typedef struct TapeDdtHashEntry { uint64_t key; ///< Key: sector address - uint32_t value; ///< Value: DDT entry + uint64_t value; ///< Value: DDT entry UT_hash_handle hh; ///< UTHASH handle } TapeDdtHashEntry; diff --git a/src/close.c b/src/close.c index b3896e9..be4c208 100644 --- a/src/close.c +++ b/src/close.c @@ -124,7 +124,7 @@ static int32_t write_cached_secondary_ddt(aaruformat_context *ctx) ddt_header.start = ctx->cached_ddt_position * items_per_ddt_entry; // Calculate data size - ddt_header.length = items_per_ddt_entry * sizeof(uint32_t); + ddt_header.length = items_per_ddt_entry * sizeof(uint64_t); // Calculate CRC64 of the data crc64_ctx *crc64_context = aaruf_crc64_init(); @@ -230,7 +230,7 @@ static int32_t write_cached_secondary_ddt(aaruformat_context *ctx) long saved_pos = ftell(ctx->imageStream); fseek(ctx->imageStream, ctx->primary_ddt_offset + sizeof(DdtHeader2), SEEK_SET); - size_t primary_table_size = ctx->user_data_ddt_header.entries * sizeof(uint32_t); + size_t primary_table_size = ctx->user_data_ddt_header.entries * sizeof(uint64_t); size_t primary_written_bytes = 0; primary_written_bytes = fwrite(ctx->user_data_ddt2, primary_table_size, 1, ctx->imageStream); @@ -322,7 +322,7 @@ static int32_t write_primary_ddt(aaruformat_context *ctx) } // Then write the table data (position is already after the header) - size_t primary_table_size = ctx->user_data_ddt_header.entries * sizeof(uint32_t); + size_t primary_table_size = ctx->user_data_ddt_header.entries * sizeof(uint64_t); // Write the primary table data size_t written_bytes = 0; diff --git a/src/create.c b/src/create.c index 58449b6..f73b702 100644 --- a/src/create.c +++ b/src/create.c @@ -519,7 +519,7 @@ void *aaruf_create(const char *filepath, const uint32_t media_type, const uint32 TRACE("Primary DDT will be placed at offset %" PRIu64, ctx->primary_ddt_offset); // Calculate size of primary DDT table - const uint64_t primary_table_size = ctx->user_data_ddt_header.entries * sizeof(uint32_t); + const uint64_t primary_table_size = ctx->user_data_ddt_header.entries * sizeof(uint64_t); // Calculate where data blocks can start (after primary DDT + header) if(ctx->user_data_ddt_header.tableShift > 0)