aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2007-12-11 17:08:04 +0200
committerLasse Collin <lasse.collin@tukaani.org>2007-12-11 17:08:04 +0200
commit918bcb0e0728d2d976621e9f35b56f224f11d989 (patch)
treee9417f878aeba2796bc44cb13a4ee06849ccf72e
parentRemove uncompressed size tracking from the filter encoders. (diff)
downloadxz-918bcb0e0728d2d976621e9f35b56f224f11d989.tar.xz
Removed uncompressed size tracking from Delta encoder too.
-rw-r--r--src/liblzma/common/delta_coder.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/liblzma/common/delta_coder.c b/src/liblzma/common/delta_coder.c
index 8a5a18b4..9b260a01 100644
--- a/src/liblzma/common/delta_coder.c
+++ b/src/liblzma/common/delta_coder.c
@@ -83,25 +83,10 @@ delta_code(lzma_coder *coder, lzma_allocator *allocator,
lzma_ret ret;
if (coder->next.code == NULL) {
- const size_t in_avail = in_size - *in_pos;
-
- if (coder->is_encoder) {
- // Check that we don't have too much input.
- if ((lzma_vli)(in_avail) > coder->uncompressed_size)
- return LZMA_DATA_ERROR;
-
- // Check that once LZMA_FINISH has been given, the
- // amount of input matches uncompressed_size if it
- // is known.
- if (action == LZMA_FINISH && coder->uncompressed_size
- != LZMA_VLI_VALUE_UNKNOWN
- && coder->uncompressed_size
- != (lzma_vli)(in_avail))
- return LZMA_DATA_ERROR;
-
- } else {
+ if (!coder->is_encoder) {
// Limit in_size so that we don't copy too much.
- if ((lzma_vli)(in_avail) > coder->uncompressed_size)
+ if ((lzma_vli)(in_size - *in_pos)
+ > coder->uncompressed_size)
in_size = *in_pos + (size_t)(
coder->uncompressed_size);
}