summaryrefslogtreecommitdiffstats
path: root/lz4hc.c
diff options
context:
space:
mode:
authoryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2012-11-30 13:23:36 (GMT)
committeryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2012-11-30 13:23:36 (GMT)
commitffb27d4eca6bd80c068e745388faa31a0982115c (patch)
treee757f211b19929628b6d50e31e7b23a6ef343f35 /lz4hc.c
parent43a03b41b26817a034301c54546638267462ecec (diff)
downloadlz4-ffb27d4eca6bd80c068e745388faa31a0982115c.zip
lz4-ffb27d4eca6bd80c068e745388faa31a0982115c.tar.gz
lz4-ffb27d4eca6bd80c068e745388faa31a0982115c.tar.bz2
LZ4 HC : extended detection window. Thanks to Adrien Grand.
Fuzzer : more tests cases lz4demo : detect write errors. Thanks to Dima Tisnek bench.c : compatibility with Solaris 64. Thanks to Thorbjørn Willoch LZ4_compressBound() : now both in inline function and macro format. Thanks to Jacob Gorm Hansen git-svn-id: https://lz4.googlecode.com/svn/trunk@84 650e7d94-2a16-8b24-b05c-7c0b3f6821cd
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))