]> git.ipfire.org Git - thirdparty/zstd.git/commit
Fix empty-block.zst golden decompression file
authorNick Terrell <terrelln@fb.com>
Wed, 8 Feb 2023 19:42:46 +0000 (11:42 -0800)
committerNick Terrell <nickrterrell@gmail.com>
Wed, 8 Feb 2023 22:11:22 +0000 (14:11 -0800)
commit83f8a05f87cc5ee94aca47d250980bde22bb7bf1
tree8a00985b92bb7939463c5da4dac6c7bf9c4d5b48
parent488f7c0ff1ea903e3beaa616fb0af311f18fea84
Fix empty-block.zst golden decompression file

This frame is invalid because the `Window_Size = 0`, and the
`Block_Maximum_Size = min(128 KB, Window_Size) = 0`. But the empty
compressed block has a `Block_Content` size of 2, which is invalid.

The fix is to switch to using a `Window_Descriptor` instead of the
`Single_Segment_Flag`. This sets the `Window_Size = 1024`.

Hexdump before this PR: `28b5 2ffd 2000 1500 0000 00`

Hexdump after this PR: `28b5 2ffd 0000 1500 0000 00`

For issue #3482.
tests/golden-decompression/empty-block.zst