mirror of
https://git.tukaani.org/xz.git
synced 2024-04-04 12:36:23 +02:00
Simplified debug/known_sizes.c to match the relaxed
requirements of Block encoder.
This commit is contained in:
parent
16e8b98f26
commit
ec490da522
1 changed files with 5 additions and 9 deletions
|
@ -64,19 +64,15 @@ main(void)
|
||||||
.filters = filters,
|
.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;
|
lzma_stream strm = LZMA_STREAM_INIT;
|
||||||
if (lzma_block_encoder(&strm, &block) != LZMA_OK)
|
if (lzma_block_encoder(&strm, &block) != LZMA_OK)
|
||||||
return 1;
|
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;
|
size_t out_size = LZMA_STREAM_HEADER_SIZE + block.header_size;
|
||||||
|
|
||||||
strm.next_in = in;
|
strm.next_in = in;
|
||||||
|
|
Loading…
Reference in a new issue