summaryrefslogtreecommitdiffstats
path: root/lz4hc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lz4hc.c')
-rw-r--r--lz4hc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lz4hc.c b/lz4hc.c
index 2ab507e..7cd8bb4 100644
--- a/lz4hc.c
+++ b/lz4hc.c
@@ -337,7 +337,7 @@ inline static int LZ4HC_InsertAndFindBestMatch (LZ4HC_Data_Structure* hc4, const
// HC4 match finder
LZ4HC_Insert(hc4, ip);
ref = HASH_POINTER(ip);
- while ((ref > (ip-MAX_DISTANCE)) && (nbAttempts))
+ while ((ref >= (ip-MAX_DISTANCE)) && (nbAttempts))
{
nbAttempts--;
if (*(ref+ml) == *(ip+ml))
@@ -380,7 +380,7 @@ inline static int LZ4HC_InsertAndGetWiderMatch (LZ4HC_Data_Structure* hc4, const
LZ4HC_Insert(hc4, ip);
ref = HASH_POINTER(ip);
- while ((ref > ip-MAX_DISTANCE) && (ref >= hc4->base) && (nbAttempts))
+ while ((ref >= ip-MAX_DISTANCE) && (ref >= hc4->base) && (nbAttempts))
{
nbAttempts--;
if (*(startLimit + longest) == *(ref - delta + longest))