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:
@@ -2333,8 +2333,8 @@ static size_t ZSTD_compressBlock_internal(ZSTD_CCtx* zc,
|
|||||||
|
|
||||||
if (frame &&
|
if (frame &&
|
||||||
/* We don't want to emit our first block as a RLE even if it qualifies because
|
/* 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."
|
* doing so will cause the decoder (cli only) to throw a "should consume all input error."
|
||||||
* https://github.com/facebook/zstd/blob/dev/programs/fileio.c#L1723
|
* This is only an issue for zstd <= v1.4.3
|
||||||
*/
|
*/
|
||||||
!zc->isFirstBlock &&
|
!zc->isFirstBlock &&
|
||||||
cSize < rleMaxLength &&
|
cSize < rleMaxLength &&
|
||||||
|
|||||||
@@ -1719,11 +1719,6 @@ static unsigned long long FIO_decompressZstdFrame(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (readSizeHint == 0) break; /* end of frame */
|
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 */
|
/* Fill input buffer */
|
||||||
{ size_t const toDecode = MIN(readSizeHint, ress->srcBufferSize); /* support large skippable frames */
|
{ size_t const toDecode = MIN(readSizeHint, ress->srcBufferSize); /* support large skippable frames */
|
||||||
|
|||||||
Binary file not shown.
+7
-2
@@ -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
|
test -f tmp.zst # destination file should still be present
|
||||||
rm tmp*
|
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 "test : compress multiple files"
|
||||||
println hello > tmp1
|
println hello > tmp1
|
||||||
@@ -638,8 +643,8 @@ $ZSTD -t tmpSplit.* && die "bad file not detected !"
|
|||||||
|
|
||||||
println "\n===> golden files tests "
|
println "\n===> golden files tests "
|
||||||
|
|
||||||
$ZSTD -t -r "$TESTDIR/files"
|
$ZSTD -t -r "$TESTDIR/golden-compression"
|
||||||
$ZSTD -c -r "$TESTDIR/files" | $ZSTD -t
|
$ZSTD -c -r "$TESTDIR/golden-compression" | $ZSTD -t
|
||||||
|
|
||||||
|
|
||||||
println "\n===> benchmark mode tests "
|
println "\n===> benchmark mode tests "
|
||||||
|
|||||||
Reference in New Issue
Block a user