diff options
author | W. Felix Handte <w@felixhandte.com> | 2018-02-02 16:41:11 (GMT) |
---|---|---|
committer | W. Felix Handte <w@felixhandte.com> | 2018-03-12 18:58:43 (GMT) |
commit | d6a3024dbb6375190e6e02ad8b06aae28e76b946 (patch) | |
tree | c99d17241fffde37f1765b87b3b0053c79f4b5bf /lib/lz4.c | |
parent | f34fb3c42dbb824af97800eefdb487dff31e0c13 (diff) | |
download | lz4-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.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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) |