summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPrzemyslaw Skibinski <inikep@gmail.com>2016-12-27 14:31:35 (GMT)
committerPrzemyslaw Skibinski <inikep@gmail.com>2016-12-27 14:31:35 (GMT)
commit20381a2fce8216b9d844c8da2ba3ecbd31118560 (patch)
tree33987e17418a9b5efd391780dc8d493d9a3d3da8 /lib
parentf4575f4f148dd62894d5d2f0af2e8b1a5fc08ae2 (diff)
downloadlz4-20381a2fce8216b9d844c8da2ba3ecbd31118560.zip
lz4-20381a2fce8216b9d844c8da2ba3ecbd31118560.tar.gz
lz4-20381a2fce8216b9d844c8da2ba3ecbd31118560.tar.bz2
fixed -BD compression
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4opt.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/lz4opt.h b/lib/lz4opt.h
index 94b38e0..46797ef 100644
--- a/lib/lz4opt.h
+++ b/lib/lz4opt.h
@@ -133,7 +133,10 @@ FORCE_INLINE int LZ4HC_BinTree_InsertAndGetAllMatches (
if (matchLength > best_mlen) {
best_mlen = matchLength;
if (matches) {
- matches[mnum].off = (int)(ip - match);
+ if (matchIndex >= dictLimit)
+ matches[mnum].off = (int)(ip - match);
+ else
+ matches[mnum].off = (int)(ip - (base + matchIndex)); /* virtual matchpos */
matches[mnum].len = (int)matchLength;
mnum++;
}