diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2008-01-23 13:36:07 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2008-01-23 13:36:07 +0200 |
commit | 99e12af4e2b866c011fe0106cd1e0bfdcc8fe9c6 (patch) | |
tree | 45a3b5e6acda6b7f61e089a1297e95dfb1f75350 /tests | |
parent | Fix a memory leak in metadata_decoder.c. (diff) | |
download | xz-99e12af4e2b866c011fe0106cd1e0bfdcc8fe9c6.tar.xz |
Fix Size of Header Metadata Block handling. Now
lzma_metadata.header_metadata_size == LZMA_VLI_VALUE_UNKNOWN
is not allowed at all. To indicate missing Header Metadata
Block, header_metadata_size must be set to zero. This is
what Metadata decoder does after this patch too.
Note that other missing fields in lzma_metadata are still
indicated with LZMA_VLI_VALUE_UNKNOWN. This isn't as
illogical as it sounds at first, because missing Size of
Header Metadata Block means that Header Metadata Block is
not present in the Stream. With other Metadata fields,
a missing field means only that the value is unknown.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_info.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_info.c b/tests/test_info.c index c073fafe..0de95431 100644 --- a/tests/test_info.c +++ b/tests/test_info.c @@ -527,7 +527,7 @@ test6(void) // still present in Footer. reset(); metadata = my_metadata; - metadata.header_metadata_size = LZMA_VLI_VALUE_UNKNOWN; + metadata.header_metadata_size = 0; expect(lzma_info_size_set(info, LZMA_INFO_HEADER_METADATA, 0) == LZMA_OK); expect(lzma_info_metadata_set(info, NULL, &metadata, true, false) @@ -539,7 +539,7 @@ test6(void) // from Footer. reset(); metadata = my_metadata; - metadata.header_metadata_size = LZMA_VLI_VALUE_UNKNOWN; + metadata.header_metadata_size = 0; expect(lzma_info_metadata_set(info, NULL, &my_metadata, true, false) == LZMA_OK); expect(lzma_info_size_set(info, LZMA_INFO_HEADER_METADATA, |