mirror of
https://github.com/facebook/zstd.git
synced 2025-08-08 17:22:10 +03:00
dst buffer should use ZSTD_compressBound to determine how much space it needs
This commit is contained in:
@@ -142,7 +142,7 @@ static adaptCCtx* createCCtx(unsigned numJobs, const char* const outFilename)
|
|||||||
for (jobNum=0; jobNum<numJobs; jobNum++) {
|
for (jobNum=0; jobNum<numJobs; jobNum++) {
|
||||||
jobDescription* job = &ctx->jobs[jobNum];
|
jobDescription* job = &ctx->jobs[jobNum];
|
||||||
job->src.start = malloc(FILE_CHUNK_SIZE);
|
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) {
|
if (!job->src.start || !job->dst.start) {
|
||||||
DISPLAY("Could not allocate buffers for jobs\n");
|
DISPLAY("Could not allocate buffers for jobs\n");
|
||||||
freeCCtx(ctx);
|
freeCCtx(ctx);
|
||||||
|
Reference in New Issue
Block a user