summaryrefslogtreecommitdiffstats
path: root/lib/lz4hc.c
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2017-11-03 17:48:55 (GMT)
committerYann Collet <cyan@fb.com>2017-11-03 17:48:55 (GMT)
commita1f4a0d98361c6ff95833dedba07a9d5a15cfa5e (patch)
treea455681bfb44e9a1d79d3d7a3cccf8934a243497 /lib/lz4hc.c
parentc9bbad53ffda4a4f4595e3a2b6e3994710ee2324 (diff)
downloadlz4-a1f4a0d98361c6ff95833dedba07a9d5a15cfa5e.zip
lz4-a1f4a0d98361c6ff95833dedba07a9d5a15cfa5e.tar.gz
lz4-a1f4a0d98361c6ff95833dedba07a9d5a15cfa5e.tar.bz2
moved ctx->end handling from parsers
responsibility better handled one layer above (LZ4HC_compress_generic())
Diffstat (limited to 'lib/lz4hc.c')
-rw-r--r--lib/lz4hc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/lz4hc.c b/lib/lz4hc.c
index a7577c5..cea83f2 100644
--- a/lib/lz4hc.c
+++ b/lib/lz4hc.c
@@ -457,7 +457,6 @@ static int LZ4HC_compress_hashChain (
if (limit == limitedDestSize && maxOutputSize < 1) return 0; /* Impossible to store anything */
if ((U32)inputSize > (U32)LZ4_MAX_INPUT_SIZE) return 0; /* Unsupported input size, too large (or negative) */
- ctx->end += inputSize;
if (limit == limitedDestSize) oend -= LASTLITERALS; /* Hack for support limitations LZ4 decompressor */
if (inputSize < LZ4_minLength) goto _last_literals; /* Input too small, no compression (all literals) */
@@ -651,7 +650,8 @@ static int LZ4HC_compress_generic (
limitedOutput_directive limit
)
{
- if (cLevel < 1) cLevel = LZ4HC_CLEVEL_DEFAULT; /* note : convention is different from lz4frame, maybe to reconsider */
+ ctx->end += *srcSizePtr;
+ if (cLevel < 1) cLevel = LZ4HC_CLEVEL_DEFAULT; /* note : convention is different from lz4frame, maybe something to review */
if (cLevel > 9) {
if (limit == limitedDestSize) cLevel = 10;
switch (cLevel) {