1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

Small LZMA_SYNC_FLUSH fixes to Block and Single-Stream encoders.

This commit is contained in:
Lasse Collin 2008-01-14 11:56:41 +02:00
parent 3599dba957
commit a670fec802
2 changed files with 3 additions and 2 deletions

View file

@ -94,7 +94,7 @@ block_encode(lzma_coder *coder, lzma_allocator *allocator,
// Main loop // Main loop
while (*out_pos < out_size while (*out_pos < out_size
&& (*in_pos < in_size || action == LZMA_FINISH)) && (*in_pos < in_size || action != LZMA_RUN))
switch (coder->sequence) { switch (coder->sequence) {
case SEQ_CODE: { case SEQ_CODE: {
const size_t in_start = *in_pos; 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, lzma_check_update(&coder->check, coder->options->check,
in + in_start, in_used); in + in_start, in_used);
if (ret != LZMA_STREAM_END) if (ret != LZMA_STREAM_END || action == LZMA_SYNC_FLUSH)
return ret; return ret;
assert(*in_pos == in_size); assert(*in_pos == in_size);

View file

@ -212,6 +212,7 @@ lzma_stream_encoder_single(
lzma_next_strm_init(strm, stream_encoder_init, options); lzma_next_strm_init(strm, stream_encoder_init, options);
strm->internal->supported_actions[LZMA_RUN] = true; strm->internal->supported_actions[LZMA_RUN] = true;
strm->internal->supported_actions[LZMA_SYNC_FLUSH] = true;
strm->internal->supported_actions[LZMA_FINISH] = true; strm->internal->supported_actions[LZMA_FINISH] = true;
return LZMA_OK; return LZMA_OK;