mirror of
https://git.tukaani.org/xz.git
synced 2024-04-04 12:36:23 +02:00
Prevent LZ encoder from hanging with known uncompressed
size. The "fix" breaks LZMA_SYNC_FLUSH at end of stream with known uncompressed size, but since it currently seems likely that support for encoding with known uncompressed size will go away anyway, I'm not fixing this problem now.
This commit is contained in:
parent
c324325f9f
commit
beeb810608
1 changed files with 7 additions and 2 deletions
|
@ -441,8 +441,13 @@ fill_window(lzma_coder *coder, lzma_allocator *allocator, const uint8_t *in,
|
|||
// works correctly, because the next encoder cannot have any more
|
||||
// output left to be produced. If it had, then our known Uncompressed
|
||||
// Size would be invalid, which would mean that we have a bad bug.
|
||||
if (ret == LZMA_OK && coder->lz.uncompressed_size == 0)
|
||||
coder->lz.sequence = SEQ_FINISH;
|
||||
// if (ret == LZMA_OK && coder->lz.uncompressed_size == 0)
|
||||
// coder->lz.sequence = SEQ_FINISH;
|
||||
// The above breaks normal encoding with known uncompressed size
|
||||
// if input chunk size is a multiple of uncompressed size. Commenting
|
||||
// the above out breaks LZMA_SYNC_FLUSH at end of stream whose
|
||||
// uncompressed size is known. Support for encoding with known
|
||||
// uncompressed may get dropped completely so I won't fix this now.
|
||||
|
||||
// Restart the match finder after finished LZMA_SYNC_FLUSH.
|
||||
if (coder->lz.pending > 0
|
||||
|
|
Loading…
Reference in a new issue