mirror of
https://github.com/facebook/zstd
synced 2026-08-22 22:32:07 -04:00
fix result buffer overrun in decode-only benchmark
This commit is contained in:
parent
5c7b7bad26
commit
902247b318
2 changed files with 6 additions and 1 deletions
|
|
@ -517,7 +517,7 @@ static BMK_benchOutcome_t BMK_benchMemAdvancedNoAlloc(
|
|||
: chunkSize;
|
||||
srcPtr += chunkSize;
|
||||
cPtr += cCapacities[chunkID];
|
||||
resPtr += chunkSize;
|
||||
resPtr += resSizes[chunkID];
|
||||
remaining -= chunkSize;
|
||||
if (adv->mode == BMK_decodeOnly) {
|
||||
cSizes[chunkID] = chunkSize;
|
||||
|
|
|
|||
|
|
@ -1308,6 +1308,11 @@ zstd -f tmp1
|
|||
zstd -b -d -i0 tmp1.zst
|
||||
println "benchmark can fail - decompression on invalid data"
|
||||
zstd -b -d -i0 tmp1 && die "invalid .zst data => benchmark should have failed"
|
||||
println "benchmark decompression of several frames whose content is smaller than the frame"
|
||||
printf 'a' > tmpbd1 ; printf 'b' > tmpbd2 ; printf 'c' > tmpbd3
|
||||
zstd -qf tmpbd1 tmpbd2 tmpbd3
|
||||
zstd -b -d -i0 tmpbd1.zst tmpbd2.zst tmpbd3.zst
|
||||
rm -f tmpbd1 tmpbd2 tmpbd3 tmpbd1.zst tmpbd2.zst tmpbd3.zst
|
||||
|
||||
GZIPMODE=1
|
||||
zstd --format=gzip -V || GZIPMODE=0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue