aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-09-10 00:33:00 +0300
committerLasse Collin <lasse.collin@tukaani.org>2008-09-10 00:33:00 +0300
commit9cfcd0c4f2f865d8fbbb46ea28344a9be0dd8ad1 (patch)
treeec6b47cb870bb6cd4832ab5af867566544d59173
parentCleaned up Block encoder and moved the no longer shared (diff)
downloadxz-9cfcd0c4f2f865d8fbbb46ea28344a9be0dd8ad1.tar.xz
Comments
-rw-r--r--src/liblzma/common/stream_encoder.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/liblzma/common/stream_encoder.c b/src/liblzma/common/stream_encoder.c
index 9d56c899..4cd08d5b 100644
--- a/src/liblzma/common/stream_encoder.c
+++ b/src/liblzma/common/stream_encoder.c
@@ -62,7 +62,11 @@ struct lzma_coder_s {
static lzma_ret
block_encoder_init(lzma_coder *coder, lzma_allocator *allocator)
{
- // Prepare the Block options.
+ // Prepare the Block options. Even though Block encoder doesn't need
+ // compressed_size, uncompressed_size, and header_size to be
+ // initialized, it is a good idea to do it here, because this way
+ // we catch if someone gave us Filter ID that cannot be used in
+ // Blocks/Streams.
coder->block_options.compressed_size = LZMA_VLI_VALUE_UNKNOWN;
coder->block_options.uncompressed_size = LZMA_VLI_VALUE_UNKNOWN;