aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-04-25 15:39:50 +0300
committerLasse Collin <lasse.collin@tukaani.org>2008-04-25 15:39:50 +0300
commitbeeb81060821dfec4e7898e0d44b7900dcb2215e (patch)
tree5f76138c6ca9a8583afd9d746270ac53cb9a5f30
parentRemoved src/liblzma/common/sysdefs.h symlink, which was (diff)
downloadxz-beeb81060821dfec4e7898e0d44b7900dcb2215e.tar.xz
Prevent LZ encoder from hanging with known uncompressedlarhzu/v4.999.3alpha
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.
-rw-r--r--src/liblzma/lz/lz_encoder.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/liblzma/lz/lz_encoder.c b/src/liblzma/lz/lz_encoder.c
index fd1be9a7..03f8fa94 100644
--- a/src/liblzma/lz/lz_encoder.c
+++ b/src/liblzma/lz/lz_encoder.c
@@ -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