From: Paul Cruz Date: Mon, 10 Jul 2017 23:10:19 +0000 (-0700) Subject: dst buffer should use ZSTD_compressBound to determine how much space it needs X-Git-Tag: v1.3.1^2~13^2^2~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c36552ef8a8aef2c097cba517346e8a7d5f0582c;p=thirdparty%2Fzstd.git dst buffer should use ZSTD_compressBound to determine how much space it needs --- diff --git a/contrib/adaptive-compression/adapt.c b/contrib/adaptive-compression/adapt.c index 1299264d8..e1ac0aaf3 100644 --- a/contrib/adaptive-compression/adapt.c +++ b/contrib/adaptive-compression/adapt.c @@ -142,7 +142,7 @@ static adaptCCtx* createCCtx(unsigned numJobs, const char* const outFilename) for (jobNum=0; jobNumjobs[jobNum]; job->src.start = malloc(FILE_CHUNK_SIZE); - job->dst.start = malloc(FILE_CHUNK_SIZE); + job->dst.start = malloc(ZSTD_compressBound(FILE_CHUNK_SIZE)); if (!job->src.start || !job->dst.start) { DISPLAY("Could not allocate buffers for jobs\n"); freeCCtx(ctx);