]> git.ipfire.org Git - thirdparty/zstd.git/commit
Fix compression failure on incompressible data 782/head
authorNick Terrell <terrelln@fb.com>
Thu, 3 Aug 2017 21:05:01 +0000 (14:05 -0700)
committerNick Terrell <terrelln@fb.com>
Mon, 7 Aug 2017 18:45:24 +0000 (11:45 -0700)
commit308047eb5dbb1659961835fce90db4883ed386a6
tree90ec2fbe9eaf09000e5e4b4d13dd551a84bcfc97
parentee27f6937c07f839939ce41bd47757b982ee1a97
Fix compression failure on incompressible data

If the destination buffer is the minimum allowed size in
`ZSTD_compressSequences()` (2^17), then if the block isn't compressible
compression might fail with `dstSize_tooSmall`, when it should instead emit
a raw uncompressed block.

Additionally, `ZSTD_compressLiterals()` implicitly called
`ZSTD_noCompressLiterals()` if Huffman compression failed. Make that
explicit.
lib/compress/zstd_compress.c