From 20381a2fce8216b9d844c8da2ba3ecbd31118560 Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Tue, 27 Dec 2016 15:31:35 +0100 Subject: fixed -BD compression --- lib/lz4opt.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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++; } -- cgit v0.12