From b88a0b4e8812777d1e715ab095738197f7f8eb96 Mon Sep 17 00:00:00 2001 From: "W. Felix Handte" Date: Mon, 26 Mar 2018 11:43:52 -0400 Subject: [PATCH] Only Perform Dict Lookup if Attempts Remain --- lib/lz4hc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lz4hc.c b/lib/lz4hc.c index 0caf001..e005cd7 100644 --- a/lib/lz4hc.c +++ b/lib/lz4hc.c @@ -288,7 +288,7 @@ LZ4HC_InsertAndGetWiderMatch ( } } } } } /* while ((matchIndex>=lowLimit) && (matchIndex < (ip - base)) && (nbAttempts)) */ - if (dictCtx != NULL) { + if (dictCtx != NULL && nbAttempts) { ptrdiff_t dictIndexDelta = dictCtx->base - dictCtx->end + lowLimit; dictMatchIndex = dictCtx->hashTable[LZ4HC_hashPtr(ip)]; matchIndex = dictMatchIndex + dictIndexDelta; -- 2.7.4