summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authortest4973 <Kdo4973@hotmail.com>2018-04-06 00:52:54 (GMT)
committertest4973 <Kdo4973@hotmail.com>2018-04-06 00:52:54 (GMT)
commitb4be1e0a743f2200eaf1c13d322c925b64b872e2 (patch)
tree48a5fa08717c9844f7dfdb5626b46915e8e84439 /lib
parentf2a4d6ef37f653c21627274634d171af66126d5e (diff)
downloadlz4-b4be1e0a743f2200eaf1c13d322c925b64b872e2.zip
lz4-b4be1e0a743f2200eaf1c13d322c925b64b872e2.tar.gz
lz4-b4be1e0a743f2200eaf1c13d322c925b64b872e2.tar.bz2
fixed byPtr match search
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index 8d8c1e8..5791556 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -694,7 +694,8 @@ LZ4_FORCE_INLINE int LZ4_compress_generic(
forwardH = LZ4_hashPosition(forwardIp, tableType);
LZ4_putPositionOnHash(ip, h, cctx->hashTable, tableType, base);
- } while ( LZ4_read32(match) != LZ4_read32(ip) );
+ } while ( (match+MAX_DISTANCE < ip)
+ || (LZ4_read32(match) != LZ4_read32(ip)) );
} else { /* byU32, byU16 */