aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma
diff options
context:
space:
mode:
Diffstat (limited to 'src/liblzma')
-rw-r--r--src/liblzma/common/metadata_decoder.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/liblzma/common/metadata_decoder.c b/src/liblzma/common/metadata_decoder.c
index 97045750..8ff4e25f 100644
--- a/src/liblzma/common/metadata_decoder.c
+++ b/src/liblzma/common/metadata_decoder.c
@@ -169,12 +169,6 @@ process(lzma_coder *coder, lzma_allocator *allocator)
return LZMA_DATA_ERROR;
--coder->todo_count;
- } else {
- // Zero indicates that Size of Header Metadata Block
- // is not present. That is, after successful Metadata
- // decoding, metadata->header_metadata_size is
- // never LZMA_VLI_VALUE_UNKNOWN.
- coder->metadata->header_metadata_size = 0;
}
coder->sequence = SEQ_TOTAL_SIZE;
@@ -494,6 +488,13 @@ metadata_decode(lzma_coder *coder, lzma_allocator *allocator,
if (coder->todo_count != 0)
return LZMA_DATA_ERROR;
+ // If Size of Header Metadata Block was not
+ // present, we use zero as its size instead
+ // of LZMA_VLI_VALUE_UNKNOWN.
+ if (coder->metadata->header_metadata_size
+ == LZMA_VLI_VALUE_UNKNOWN)
+ coder->metadata->header_metadata_size = 0;
+
return LZMA_STREAM_END;
}
}