diff options
author | Przemyslaw Skibinski <inikep@gmail.com> | 2016-12-28 12:19:11 (GMT) |
---|---|---|
committer | Przemyslaw Skibinski <inikep@gmail.com> | 2016-12-28 12:19:11 (GMT) |
commit | 12aae846b3006d7cd76a1197992eab1a0e995466 (patch) | |
tree | 888c97a3c8ef6f299fce4190cd03adf0166ba6bb | |
parent | c8b31263ccbf687c4ea05f29da2011462d1e8e5b (diff) | |
download | lz4-12aae846b3006d7cd76a1197992eab1a0e995466.zip lz4-12aae846b3006d7cd76a1197992eab1a0e995466.tar.gz lz4-12aae846b3006d7cd76a1197992eab1a0e995466.tar.bz2 |
fixed table update in LZ4_loadDictHC
-rw-r--r-- | lib/lz4hc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/lz4hc.c b/lib/lz4hc.c index b2930de..3097df2 100644 --- a/lib/lz4hc.c +++ b/lib/lz4hc.c @@ -564,8 +564,11 @@ int LZ4_loadDictHC (LZ4_streamHC_t* LZ4_streamHCPtr, const char* dictionary, int dictSize = 64 KB; } LZ4HC_init (ctxPtr, (const BYTE*)dictionary); - if (dictSize >= 4) LZ4HC_Insert (ctxPtr, (const BYTE*)dictionary + (dictSize-3)); ctxPtr->end = (const BYTE*)dictionary + dictSize; + if (ctxPtr->compressionLevel >= LZ4HC_CLEVEL_OPT_MIN) + LZ4HC_updateBinTree(ctxPtr, ctxPtr->end - MFLIMIT, ctxPtr->end - LASTLITERALS); + else + if (dictSize >= 4) LZ4HC_Insert (ctxPtr, ctxPtr->end-3); return dictSize; } |