diff --git a/lib/zstdhc.c b/lib/zstdhc.c index 13a035b8fb0..d9b587b96bb 100644 --- a/lib/zstdhc.c +++ b/lib/zstdhc.c @@ -794,6 +794,7 @@ size_t ZSTD_HC_compressBlock_greedy(ZSTD_HC_CCtx* ctx, void* dst, size_t maxDstS size_t offset=999999; size_t matchLength = ZSTD_HC_HcFindBestMatch_selectMLS(ctx, ip, iend, &offset, maxSearches, mls); if (!matchLength) { ip++; continue; } + while ((ip>anchor) && (ip-offset>ctx->base) && (ip[-1] == ip[-1-offset])) { ip--; } /* catch up */ /* store sequence */ { size_t litLength = ip-anchor; diff --git a/programs/paramgrill.c b/programs/paramgrill.c index a188a41c561..5c67772a7dd 100644 --- a/programs/paramgrill.c +++ b/programs/paramgrill.c @@ -997,7 +997,7 @@ int main(int argc, char** argv) argument++; while ((*argument>= '0') && (*argument<='9')) cLevel *= 10, cLevel += *argument++ - '0'; - if (cLevel < 2) cLevel = 2; + if (cLevel < 1) cLevel = 1; if (cLevel > ZSTD_HC_MAX_CLEVEL) cLevel = ZSTD_HC_MAX_CLEVEL; g_params = g_seedParams[cLevel]; continue;