summaryrefslogtreecommitdiffstats
path: root/lib/lz4.c
diff options
context:
space:
mode:
authorW. Felix Handte <w@felixhandte.com>2018-02-02 16:41:11 (GMT)
committerW. Felix Handte <w@felixhandte.com>2018-03-12 18:58:43 (GMT)
commitd6a3024dbb6375190e6e02ad8b06aae28e76b946 (patch)
treec99d17241fffde37f1765b87b3b0053c79f4b5bf /lib/lz4.c
parentf34fb3c42dbb824af97800eefdb487dff31e0c13 (diff)
downloadlz4-d6a3024dbb6375190e6e02ad8b06aae28e76b946.zip
lz4-d6a3024dbb6375190e6e02ad8b06aae28e76b946.tar.gz
lz4-d6a3024dbb6375190e6e02ad8b06aae28e76b946.tar.bz2
Add LZ4_compress_fast_safeExtState Function
Diffstat (limited to 'lib/lz4.c')
-rw-r--r--lib/lz4.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index 7b8de77..45cc7c9 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -739,9 +739,17 @@ _clean_up:
int LZ4_compress_fast_extState(void* state, const char* source, char* dest, int inputSize, int maxOutputSize, int acceleration)
{
+ LZ4_resetStream((LZ4_stream_t*)state);
+ return LZ4_compress_fast_safeExtState(state, source, dest, inputSize, maxOutputSize, acceleration);
+}
+
+
+int LZ4_compress_fast_safeExtState(void* state, const char* source, char* dest, int inputSize, int maxOutputSize, int acceleration)
+{
LZ4_stream_t_internal* ctx = &((LZ4_stream_t*)state)->internal_donotuse;
- LZ4_resetStream((LZ4_stream_t*)state);
if (acceleration < 1) acceleration = ACCELERATION_DEFAULT;
+ ctx->dictionary = NULL;
+ ctx->dictSize = 0;
if (maxOutputSize >= LZ4_compressBound(inputSize)) {
if (inputSize < LZ4_64Klimit)