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++) {
|
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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user