mirror of
https://github.com/facebook/zstd.git
synced 2025-11-22 00:10:22 -05:00
Merge pull request #1773 from bimbashrestha/rle_first_block_decompression_fix
Removing redundant condition in decompression, making first block rle…
This commit is contained in:
commit
41416f0927
@ -2333,8 +2333,8 @@ static size_t ZSTD_compressBlock_internal(ZSTD_CCtx* zc,
|
||||
|
||||
if (frame &&
|
||||
/* We don't want to emit our first block as a RLE even if it qualifies because
|
||||
* doing so will cause the decoder to throw a "should consume all input error."
|
||||
* https://github.com/facebook/zstd/blob/dev/programs/fileio.c#L1723
|
||||
* doing so will cause the decoder (cli only) to throw a "should consume all input error."
|
||||
* This is only an issue for zstd <= v1.4.3
|
||||
*/
|
||||
!zc->isFirstBlock &&
|
||||
cSize < rleMaxLength &&
|
||||
|
||||
@ -1719,11 +1719,6 @@ static unsigned long long FIO_decompressZstdFrame(
|
||||
}
|
||||
|
||||
if (readSizeHint == 0) break; /* end of frame */
|
||||
if (inBuff.size != inBuff.pos) {
|
||||
DISPLAYLEVEL(1, "%s : Decoding error (37) : should consume entire input \n",
|
||||
srcFileName);
|
||||
return FIO_ERROR_FRAME_DECODING;
|
||||
}
|
||||
|
||||
/* Fill input buffer */
|
||||
{ size_t const toDecode = MIN(readSizeHint, ress->srcBufferSize); /* support large skippable frames */
|
||||
|
||||
BIN
tests/golden-decompression/rle-first-block.zst
Normal file
BIN
tests/golden-decompression/rle-first-block.zst
Normal file
Binary file not shown.
@ -241,6 +241,11 @@ $ZSTD -f tmp && die "attempt to compress a non existing file"
|
||||
test -f tmp.zst # destination file should still be present
|
||||
rm tmp*
|
||||
|
||||
println "\n===> decompression only tests "
|
||||
head -c 1048576 /dev/zero > tmp
|
||||
$ZSTD -d -o tmp1 "$TESTDIR/golden-decompression/rle-first-block.zst"
|
||||
$DIFF -s tmp1 tmp
|
||||
rm tmp*
|
||||
|
||||
println "test : compress multiple files"
|
||||
println hello > tmp1
|
||||
@ -638,8 +643,8 @@ $ZSTD -t tmpSplit.* && die "bad file not detected !"
|
||||
|
||||
println "\n===> golden files tests "
|
||||
|
||||
$ZSTD -t -r "$TESTDIR/files"
|
||||
$ZSTD -c -r "$TESTDIR/files" | $ZSTD -t
|
||||
$ZSTD -t -r "$TESTDIR/golden-compression"
|
||||
$ZSTD -c -r "$TESTDIR/golden-compression" | $ZSTD -t
|
||||
|
||||
|
||||
println "\n===> benchmark mode tests "
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user