aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-01-14 11:56:41 +0200
committerLasse Collin <lasse.collin@tukaani.org>2008-01-14 11:56:41 +0200
commita670fec8021e5962429689c194148a04c3418872 (patch)
tree0e737a409422785963e97aac1a0792cf78d3d8bc /src/liblzma/common
parentMore fixes to LZMA decoder's flush marker handling. (diff)
downloadxz-a670fec8021e5962429689c194148a04c3418872.tar.xz
Small LZMA_SYNC_FLUSH fixes to Block and Single-Stream encoders.
Diffstat (limited to 'src/liblzma/common')
-rw-r--r--src/liblzma/common/block_encoder.c4
-rw-r--r--src/liblzma/common/stream_encoder_single.c1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/liblzma/common/block_encoder.c b/src/liblzma/common/block_encoder.c
index 22451b9b..4dc9f6bb 100644
--- a/src/liblzma/common/block_encoder.c
+++ b/src/liblzma/common/block_encoder.c
@@ -94,7 +94,7 @@ block_encode(lzma_coder *coder, lzma_allocator *allocator,
// Main loop
while (*out_pos < out_size
- && (*in_pos < in_size || action == LZMA_FINISH))
+ && (*in_pos < in_size || action != LZMA_RUN))
switch (coder->sequence) {
case SEQ_CODE: {
const size_t in_start = *in_pos;
@@ -121,7 +121,7 @@ block_encode(lzma_coder *coder, lzma_allocator *allocator,
lzma_check_update(&coder->check, coder->options->check,
in + in_start, in_used);
- if (ret != LZMA_STREAM_END)
+ if (ret != LZMA_STREAM_END || action == LZMA_SYNC_FLUSH)
return ret;
assert(*in_pos == in_size);
diff --git a/src/liblzma/common/stream_encoder_single.c b/src/liblzma/common/stream_encoder_single.c
index cd835dcb..d93e7169 100644
--- a/src/liblzma/common/stream_encoder_single.c
+++ b/src/liblzma/common/stream_encoder_single.c
@@ -212,6 +212,7 @@ lzma_stream_encoder_single(
lzma_next_strm_init(strm, stream_encoder_init, options);
strm->internal->supported_actions[LZMA_RUN] = true;
+ strm->internal->supported_actions[LZMA_SYNC_FLUSH] = true;
strm->internal->supported_actions[LZMA_FINISH] = true;
return LZMA_OK;