dst buffer should use ZSTD_compressBound to determine how much space it needs

This commit is contained in:
Paul Cruz 2017-07-10 16:10:19 -07:00
parent 7aa36df6df
commit c36552ef8a

View File

@ -142,7 +142,7 @@ static adaptCCtx* createCCtx(unsigned numJobs, const char* const outFilename)
for (jobNum=0; jobNum<numJobs; jobNum++) {
jobDescription* job = &ctx->jobs[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);