Also Reset the Chain Table

This commit is contained in:
W. Felix Handte 2018-04-20 14:16:27 -04:00
parent 8f118cf6e9
commit ca833f928f

View File

@ -98,7 +98,7 @@ static void LZ4HC_init (LZ4HC_CCtx_internal* hc4, const BYTE* start)
uptrval startingOffset = hc4->end - hc4->base; uptrval startingOffset = hc4->end - hc4->base;
DEBUGLOG(4, "LZ4HC_init(%p, %p)", hc4, start); DEBUGLOG(4, "LZ4HC_init(%p, %p)", hc4, start);
if (startingOffset > 1 GB || startingOffset > (uptrval)start) { if (startingOffset > 1 GB || startingOffset > (uptrval)start) {
MEM_INIT((void*)hc4->hashTable, 0, sizeof(hc4->hashTable)); LZ4HC_clearTables(hc4);
startingOffset = 0; startingOffset = 0;
} }
startingOffset += MAX_DISTANCE; startingOffset += MAX_DISTANCE;