mirror of
https://github.com/facebook/zstd.git
synced 2024-11-24 03:46:45 +08:00
dst buffer should use ZSTD_compressBound to determine how much space it needs
This commit is contained in:
parent
7aa36df6df
commit
c36552ef8a
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user