summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-12-16 01:13:19 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-12-16 01:13:19 (GMT)
commit95cc6cef6444b202a93ba414b7a9996eb2c72ca3 (patch)
tree3a2a7c48aa32847b5e132ba815609b427bdfbb7f /lib
parent7a8cd6996072f53f83ded52a325a4c4a4aed5a35 (diff)
downloadlz4-95cc6cef6444b202a93ba414b7a9996eb2c72ca3.zip
lz4-95cc6cef6444b202a93ba414b7a9996eb2c72ca3.tar.gz
lz4-95cc6cef6444b202a93ba414b7a9996eb2c72ca3.tar.bz2
Fixed : bug within LZ4 HC streaming mode, reported by James Boyle
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4.c2
-rw-r--r--lib/lz4hc.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index d622584..a365375 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -541,7 +541,7 @@ static int LZ4_compress_generic(
break;
}
if ((tableType == byU16) && (inputSize>=LZ4_64Klimit)) return 0; /* Size too large (not within 64K limit) */
- if (inputSize<LZ4_minLength) goto _last_literals; /* Input too small, no compression (all literals) */
+ if (inputSize<LZ4_minLength) goto _last_literals; /* Input too small, no compression (all literals) */
/* First Byte */
LZ4_putPosition(ip, ctx, tableType, base);
diff --git a/lib/lz4hc.c b/lib/lz4hc.c
index 45f1208..ef3997b 100644
--- a/lib/lz4hc.c
+++ b/lib/lz4hc.c
@@ -693,6 +693,7 @@ int LZ4_saveDictHC (LZ4_streamHC_t* LZ4_streamHCPtr, char* safeBuffer, int dictS
streamPtr->base = streamPtr->end - endIndex;
streamPtr->dictLimit = endIndex - dictSize;
streamPtr->lowLimit = endIndex - dictSize;
+ if (streamPtr->nextToUpdate < streamPtr->dictLimit) streamPtr->nextToUpdate = streamPtr->dictLimit;
}
return dictSize;
}