aboutsummaryrefslogtreecommitdiff
path: root/debug/known_sizes.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-09-11 23:10:44 +0300
committerLasse Collin <lasse.collin@tukaani.org>2008-09-11 23:10:44 +0300
commitec490da5228263b25bf786bb23d1008468f55b30 (patch)
tree83611ee21627d5cc43840e1646ac714cd889697e /debug/known_sizes.c
parentRemove a check from Block encoder that should have already (diff)
downloadxz-ec490da5228263b25bf786bb23d1008468f55b30.tar.xz
Simplified debug/known_sizes.c to match the relaxed
requirements of Block encoder.
Diffstat (limited to '')
-rw-r--r--debug/known_sizes.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/debug/known_sizes.c b/debug/known_sizes.c
index 571c105e..24ccd96c 100644
--- a/debug/known_sizes.c
+++ b/debug/known_sizes.c
@@ -64,19 +64,15 @@ main(void)
.filters = filters,
};
- // FIXME Insane paranoia in liblzma.
- if (lzma_block_header_size(&block) != LZMA_OK)
- return 1;
-
- // We don't actually know the compressed size, so don't tell it to
- // Block encoder.
- block.compressed_size = LZMA_VLI_VALUE_UNKNOWN;
-
lzma_stream strm = LZMA_STREAM_INIT;
if (lzma_block_encoder(&strm, &block) != LZMA_OK)
return 1;
- // Reserve space for Stream Header and Block Header.
+ // Reserve space for Stream Header and Block Header. We need to
+ // calculate the size of the Block Header first.
+ if (lzma_block_header_size(&block) != LZMA_OK)
+ return 1;
+
size_t out_size = LZMA_STREAM_HEADER_SIZE + block.header_size;
strm.next_in = in;