From 2811f41734f5997e86b497d10b8dec124d816208 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Fri, 1 Aug 2025 02:48:16 +0100 Subject: [PATCH] [lib] Fix data size mismatch. --- docs/spec/blocks/data.adoc | 2 +- docs/spec/blocks/ddt.adoc | 2 +- include/aaruformat/context.h | 26 +++++++++++++------------- include/aaruformat/structs/data.h | 2 +- include/aaruformat/structs/ddt.h | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/spec/blocks/data.adoc b/docs/spec/blocks/data.adoc index a531345..ed0ecea 100644 --- a/docs/spec/blocks/data.adoc +++ b/docs/spec/blocks/data.adoc @@ -17,7 +17,7 @@ typedef struct BlockHeader /**Identifier, */ uint32_t identifier; /**Type of data contained by this block */ - uint32_t type; + uint16_t type; /**Compression algorithm used to compress the block */ uint16_t compression; /**Size in uint8_ts of each sector contained in this block */ diff --git a/docs/spec/blocks/ddt.adoc b/docs/spec/blocks/ddt.adoc index a84d403..4072ca0 100644 --- a/docs/spec/blocks/ddt.adoc +++ b/docs/spec/blocks/ddt.adoc @@ -16,7 +16,7 @@ typedef struct DdtHeader /**Identifier, */ uint32_t identifier; /**Type of data pointed by this DDT */ - uint32_t type; + uint16_t type; /**Compression algorithm used to compress the DDT */ uint16_t compression; /**Each entry is ((uint8_t offset in file) << shift) + (sector offset in block) */ diff --git a/include/aaruformat/context.h b/include/aaruformat/context.h index 20fb54f..8fd09aa 100644 --- a/include/aaruformat/context.h +++ b/include/aaruformat/context.h @@ -34,6 +34,19 @@ #define SHA256_DIGEST_LENGTH 32 #endif +typedef struct Crc64Context { + uint64_t finalSeed; + uint64_t table[256]; + uint64_t hashInt; +} Crc64Context; + +typedef struct CdEccContext { + bool initedEdc; + uint8_t *eccBTable; + uint8_t *eccFTable; + uint32_t *edcTable; +} CdEccContext; + typedef struct Checksums { bool hasMd5; @@ -117,17 +130,4 @@ typedef struct DumpExtent #pragma pack(pop) -typedef struct Crc64Context { - uint64_t finalSeed; - uint64_t table[256]; - uint64_t hashInt; -} Crc64Context; - -typedef struct CdEccContext { - bool initedEdc; - uint8_t *eccBTable; - uint8_t *eccFTable; - uint32_t *edcTable; -} CdEccContext; - #endif // LIBAARUFORMAT_CONTEXT_H diff --git a/include/aaruformat/structs/data.h b/include/aaruformat/structs/data.h index 279a191..0b9b259 100644 --- a/include/aaruformat/structs/data.h +++ b/include/aaruformat/structs/data.h @@ -26,7 +26,7 @@ typedef struct BlockHeader { /**Identifier, */ uint32_t identifier; /**Type of data contained by this block */ - uint32_t type; + uint16_t type; /**Compression algorithm used to compress the block */ uint16_t compression; /**Size in uint8_ts of each sector contained in this block */ diff --git a/include/aaruformat/structs/ddt.h b/include/aaruformat/structs/ddt.h index d07fb98..a0bf253 100644 --- a/include/aaruformat/structs/ddt.h +++ b/include/aaruformat/structs/ddt.h @@ -26,7 +26,7 @@ typedef struct DdtHeader { /**Identifier, */ uint32_t identifier; /**Type of data pointed by this DDT */ - uint32_t type; + uint16_t type; /**Compression algorithm used to compress the DDT */ uint16_t compression; /**Each entry is ((uint8_t offset in file) << shift) + (sector offset in block) */