Skip to content

Commit 504c4a1

Browse files
authored
Merge pull request #3620 from facebook/errata_128k
[doc] add decoder errata paragraph
2 parents 61efb2a + 0d6954b commit 504c4a1

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

doc/decompressor_errata.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,32 @@ Each entry will contain:
66
1. The last affected decompressor versions.
77
2. The decompressor components affected.
88
2. Whether the compressed frame could ever be produced by the reference compressor.
9-
3. An example frame.
9+
3. An example frame (hexadecimal string when it can be short enough, link to golden file otherwise)
1010
4. A description of the bug.
1111

1212
The document is in reverse chronological order, with the bugs that affect the most recent zstd decompressor versions listed first.
1313

1414

15+
Compressed block with a size of exactly 128 KB
16+
------------------------------------------------
17+
18+
**Last affected version**: v1.5.2
19+
20+
**Affected decompressor component(s)**: Library & CLI
21+
22+
**Produced by the reference compressor**: No
23+
24+
**Example Frame**: see zstd/tests/golden-decompression/block-128k.zst
25+
26+
The zstd decoder incorrectly rejected blocks of type `Compressed_Block` when their size was exactly 128 KB.
27+
Note that `128 KB - 1` was accepted, and `128 KB + 1` is forbidden by the spec.
28+
29+
This type of block was never generated by the reference compressor.
30+
31+
These blocks used to be disallowed by the spec up until spec version 0.3.2 when the restriction was lifted by [PR#1689](https://github.com/facebook/zstd/pull/1689).
32+
33+
> A Compressed_Block has the extra restriction that Block_Size is always strictly less than the decompressed size. If this condition cannot be respected, the block must be sent uncompressed instead (Raw_Block).
34+
1535
Compressed block with 0 literals and 0 sequences
1636
------------------------------------------------
1737

doc/educational_decoder/zstd_decompress.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ size_t ZSTD_get_decompressed_size(const void *src, const size_t src_len) {
13991399
/******* END OUTPUT SIZE COUNTING *********************************************/
14001400

14011401
/******* DICTIONARY PARSING ***************************************************/
1402-
dictionary_t* create_dictionary() {
1402+
dictionary_t* create_dictionary(void) {
14031403
dictionary_t* const dict = calloc(1, sizeof(dictionary_t));
14041404
if (!dict) {
14051405
BAD_ALLOC();
128 KB
Binary file not shown.

0 commit comments

Comments
 (0)