diff options
author | Yann Collet <cyan@fb.com> | 2019-04-09 20:55:42 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2019-04-09 20:55:42 (GMT) |
commit | 14c71dfa9cc7161e1283e27bc688fd2bbeb637a2 (patch) | |
tree | 1cb94bbf24665abc35f72e9fd30663f9228740d8 /lib/lz4frame.c | |
parent | 5ef4f3ce913dae19f6bcd065a2b231c5461e4233 (diff) | |
download | lz4-14c71dfa9cc7161e1283e27bc688fd2bbeb637a2.zip lz4-14c71dfa9cc7161e1283e27bc688fd2bbeb637a2.tar.gz lz4-14c71dfa9cc7161e1283e27bc688fd2bbeb637a2.tar.bz2 |
modified LZ4_initStreamHC() to look like LZ4_initStream()
it is now a pure initializer, for statically allocated states.
It can initialize any memory area, and because of this, requires size.
Diffstat (limited to 'lib/lz4frame.c')
-rw-r--r-- | lib/lz4frame.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/lz4frame.c b/lib/lz4frame.c index 3b4fcee..efe38da 100644 --- a/lib/lz4frame.c +++ b/lib/lz4frame.c @@ -630,7 +630,8 @@ size_t LZ4F_compressBegin_usingCDict(LZ4F_cctx* cctxPtr, if (cctxPtr->prefs.compressionLevel < LZ4HC_CLEVEL_MIN) { LZ4_initStream((LZ4_stream_t *) cctxPtr->lz4CtxPtr, sizeof (LZ4_stream_t)); } else { - LZ4_initStreamHC((LZ4_streamHC_t *) cctxPtr->lz4CtxPtr, cctxPtr->prefs.compressionLevel); + LZ4_initStreamHC((LZ4_streamHC_t *) cctxPtr->lz4CtxPtr, sizeof(LZ4_streamHC_t)); + LZ4_setCompressionLevel((LZ4_streamHC_t *) cctxPtr->lz4CtxPtr, cctxPtr->prefs.compressionLevel); } cctxPtr->lz4CtxState = ctxTypeID; } |