summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorremittor <remittor@gmail.com>2017-03-09 09:19:24 (GMT)
committerremittor <remittor@gmail.com>2017-03-09 09:19:24 (GMT)
commit36842ebb1978a3e500572ead564e60e513c4ad0a (patch)
tree279f4ef0265b3bbe3eefa4481bfd9b1015b0a847 /lib
parentbaa155088b2700526cb97e97b6e2ce4199bf264c (diff)
downloadlz4-36842ebb1978a3e500572ead564e60e513c4ad0a.zip
lz4-36842ebb1978a3e500572ead564e60e513c4ad0a.tar.gz
lz4-36842ebb1978a3e500572ead564e60e513c4ad0a.tar.bz2
lz4hc: Fix LZ4HC_compress_hashChain for backward compatibility
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4hc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/lz4hc.c b/lib/lz4hc.c
index 618ed8a..290e575 100644
--- a/lib/lz4hc.c
+++ b/lib/lz4hc.c
@@ -351,7 +351,7 @@ static int LZ4HC_compress_hashChain (
/* init */
*srcSizePtr = 0;
- if (limit && maxOutputSize < 1) return 0; /* Impossible to store anything */
+ 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;
@@ -509,7 +509,7 @@ _last_literals:
if (limit == limitedDestSize) oend += LASTLITERALS; /* restore correct value */
if (limit && (op + totalSize > oend)) {
if (limit == limitedOutput) return 0; /* Check output limit */
- /* adapt lastRunSize to fill 'dst' */
+ /* adapt lastRunSize to fill 'dest' */
lastRunSize = (size_t)(oend - op) - 1;
litLength = (lastRunSize + 255 - RUN_MASK) / 255;
lastRunSize -= litLength;