diff --git a/programs/benchzstd.c b/programs/benchzstd.c index f55c8697504..4bc300b81b6 100644 --- a/programs/benchzstd.c +++ b/programs/benchzstd.c @@ -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; diff --git a/tests/playTests.sh b/tests/playTests.sh index d8ea0c3dad3..57a962dd9c8 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -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