mirror of
https://github.com/facebook/zstd.git
synced 2025-12-07 00:02:39 -05:00
fixed zbuff error 775-3 (internal buffer management)
This commit is contained in:
parent
efb18309ef
commit
1d803d8deb
@ -135,8 +135,9 @@ size_t ZBUFF_compressInit_advanced(ZBUFF_CCtx* zbc,
|
|||||||
free(zbc->inBuff); /* should not be necessary */
|
free(zbc->inBuff); /* should not be necessary */
|
||||||
zbc->inBuff = (char*)malloc(neededInBuffSize);
|
zbc->inBuff = (char*)malloc(neededInBuffSize);
|
||||||
if (zbc->inBuff == NULL) return ERROR(memory_allocation);
|
if (zbc->inBuff == NULL) return ERROR(memory_allocation);
|
||||||
} }
|
}
|
||||||
zbc->blockSize = MIN(ZSTD_BLOCKSIZE_MAX, zbc->inBuffSize);
|
zbc->blockSize = MIN(ZSTD_BLOCKSIZE_MAX, neededInBuffSize);
|
||||||
|
}
|
||||||
if (zbc->outBuffSize < ZSTD_compressBound(zbc->blockSize)+1) {
|
if (zbc->outBuffSize < ZSTD_compressBound(zbc->blockSize)+1) {
|
||||||
zbc->outBuffSize = ZSTD_compressBound(zbc->blockSize)+1;
|
zbc->outBuffSize = ZSTD_compressBound(zbc->blockSize)+1;
|
||||||
free(zbc->outBuff); /* should not be necessary */
|
free(zbc->outBuff); /* should not be necessary */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user