diff options
-rw-r--r-- | lib/lz4hc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/lz4hc.c b/lib/lz4hc.c index 4a52f0c..5479159 100644 --- a/lib/lz4hc.c +++ b/lib/lz4hc.c @@ -93,12 +93,13 @@ static void LZ4HC_clearTables (LZ4HC_CCtx_internal* hc4) static void LZ4HC_init (LZ4HC_CCtx_internal* hc4, const BYTE* start) { - U32 startingOffset = hc4->end - hc4->base + 64 KB; + uptrval startingOffset = hc4->end - hc4->base; DEBUGLOG(4, "LZ4HC_init(%p, %p)", hc4, start); if (startingOffset > 1 GB || startingOffset > (uptrval)start) { MEM_INIT((void*)hc4->hashTable, 0, sizeof(hc4->hashTable)); - startingOffset = 64 KB; + startingOffset = 0; } + startingOffset += MAX_DISTANCE; hc4->nextToUpdate = startingOffset; hc4->base = start - startingOffset; hc4->end = start; |