From: inikep Date: Thu, 25 Feb 2016 21:31:07 +0000 (+0100) Subject: fixed ZSTD_copyCCtx X-Git-Tag: v0.6.0^2~17^2~92^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f414647c6b6639cb92a85faca16341e9f0a1eba3;p=thirdparty%2Fzstd.git fixed ZSTD_copyCCtx --- diff --git a/lib/zstd_compress.c b/lib/zstd_compress.c index 8a5f6f696..5edd34343 100644 --- a/lib/zstd_compress.c +++ b/lib/zstd_compress.c @@ -228,8 +228,8 @@ static size_t ZSTD_resetCCtx_advanced (ZSTD_CCtx* zc, size_t ZSTD_copyCCtx(ZSTD_CCtx* dstCCtx, const ZSTD_CCtx* srcCCtx) { const U32 contentLog = (srcCCtx->params.strategy == ZSTD_fast) ? 1 : srcCCtx->params.contentLog; - const size_t tableSpace = ((1 << contentLog) + (1 << srcCCtx->params.hashLog)) * sizeof(U32); - + const size_t tableSpace = ((1 << contentLog) + (1 << srcCCtx->params.hashLog) + (1 << srcCCtx->params.hashLog3)) * sizeof(U32); + if (srcCCtx->stage!=0) return ERROR(stage_wrong); ZSTD_resetCCtx_advanced(dstCCtx, srcCCtx->params); @@ -243,6 +243,7 @@ size_t ZSTD_copyCCtx(ZSTD_CCtx* dstCCtx, const ZSTD_CCtx* srcCCtx) /* copy dictionary pointers */ dstCCtx->nextToUpdate= srcCCtx->nextToUpdate; + dstCCtx->nextToUpdate3 = srcCCtx->nextToUpdate3; dstCCtx->nextSrc = srcCCtx->nextSrc; dstCCtx->base = srcCCtx->base; dstCCtx->dictBase = srcCCtx->dictBase; diff --git a/lib/zstd_decompress.c b/lib/zstd_decompress.c index 8cedb3ea9..a57469866 100644 --- a/lib/zstd_decompress.c +++ b/lib/zstd_decompress.c @@ -159,6 +159,7 @@ size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx) dctx->dictEnd = NULL; dctx->hufTableX4[0] = HufLog; dctx->flagStaticTables = 0; + dctx->params.searchLength = MINMATCH; return 0; }