summaryrefslogtreecommitdiffstats
path: root/lib/lz4hc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lz4hc.c')
-rw-r--r--lib/lz4hc.c2
1 files changed, 1 insertions, 1 deletions
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;