Skip to content

Commit 4955976

Browse files
authored
Merge pull request #2729 from felixhandte/fix-ddss-load
Fix DDSS Load
2 parents d2b5e54 + da58821 commit 4955976

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/compress/zstd_lazy.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ void ZSTD_dedicatedDictSearch_lazy_loadDictionary(ZSTD_matchState_t* ms, const B
450450
U32* const chainTable = ms->chainTable;
451451
U32 const chainSize = 1 << ms->cParams.chainLog;
452452
U32 idx = ms->nextToUpdate;
453-
U32 const minChain = chainSize < target ? target - chainSize : idx;
453+
U32 const minChain = chainSize < target - idx ? target - chainSize : idx;
454454
U32 const bucketSize = 1 << ZSTD_LAZY_DDSS_BUCKET_LOG;
455455
U32 const cacheSize = bucketSize - 1;
456456
U32 const chainAttempts = (1 << ms->cParams.searchLog) - cacheSize;

0 commit comments

Comments
 (0)