committed by
Nick Terrell
parent
329169189c
commit
b4467c1061
@@ -1172,10 +1172,15 @@ ZSTD_checkDictValidity(const ZSTD_window_t* window,
|
||||
(unsigned)blockEndIdx, (unsigned)maxDist, (unsigned)loadedDictEnd);
|
||||
assert(blockEndIdx >= loadedDictEnd);
|
||||
|
||||
if (blockEndIdx > loadedDictEnd + maxDist) {
|
||||
if (blockEndIdx > loadedDictEnd + maxDist || loadedDictEnd != window->dictLimit) {
|
||||
/* On reaching window size, dictionaries are invalidated.
|
||||
* For simplification, if window size is reached anywhere within next block,
|
||||
* the dictionary is invalidated for the full block.
|
||||
*
|
||||
* We also have to invalidate the dictionary if ZSTD_window_update() has detected
|
||||
* non-contiguous segments, which means that loadedDictEnd != window->dictLimit.
|
||||
* loadedDictEnd may be 0, if forceWindow is true, but in that case we never use
|
||||
* dictMatchState, so setting it to NULL is not a problem.
|
||||
*/
|
||||
DEBUGLOG(6, "invalidating dictionary for current block (distance > windowSize)");
|
||||
*loadedDictEndPtr = 0;
|
||||
|
||||
Reference in New Issue
Block a user