fixed repcode bug

dev
Yann Collet 2015-11-17 12:23:53 +01:00
parent 82368cfa1b
commit 786eb7d42e
1 changed files with 1 additions and 1 deletions

View File

@ -863,7 +863,7 @@ size_t ZSTD_compressBlock_fast_extDict_generic(ZSTD_CCtx* ctx,
{
size_t litLength = ip-anchor;
size_t maxLength = MIN((size_t)(iend-ip-MINMATCH), (size_t)(dictLimit - matchIndex)); /* works even if matchIndex > dictLimit */
size_t maxLength = matchIndex < dictLimit ? MIN((size_t)(iend-ip-MINMATCH), (size_t)(dictLimit - matchIndex)) : (size_t)(iend-ip-MINMATCH);
const BYTE* const iEndCount = ip + maxLength;
size_t matchLength = ZSTD_count(ip+MINMATCH, match+MINMATCH, iEndCount);
size_t offsetCode = current-matchIndex;