// 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;
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);
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;