]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
added golden file for the new decompressor erratum 3620/head
authorYann Collet <cyan@fb.com>
Wed, 19 Apr 2023 07:24:35 +0000 (00:24 -0700)
committerYann Collet <cyan@fb.com>
Wed, 19 Apr 2023 07:24:35 +0000 (00:24 -0700)
doc/decompressor_errata.md
doc/educational_decoder/zstd_decompress.c
tests/golden-decompression/block-128k.zst [new file with mode: 0644]

index 6c99cb01f46ac732d6b31f229320b82f2e5e0754..e170a62c155c870836d6262ace0bff000e827446 100644 (file)
@@ -6,7 +6,7 @@ Each entry will contain:
 1. The last affected decompressor versions.
 2. The decompressor components affected.
 2. Whether the compressed frame could ever be produced by the reference compressor.
-3. An example frame when it can be short enough to be displayed as hexadecimal
+3. An example frame (hexadecimal string when it can be short enough, link to golden file otherwise)
 4. A description of the bug.
 
 The document is in reverse chronological order, with the bugs that affect the most recent zstd decompressor versions listed first.
@@ -21,7 +21,10 @@ Compressed block with a size of exactly 128 KB
 
 **Produced by the reference compressor**: No
 
+**Example Frame**: see zstd/tests/golden-decompression/block-128k.zst
+
 The zstd decoder incorrectly rejected blocks of type `Compressed_Block` when their size was exactly 128 KB.
+Note that `128 KB - 1` was accepted, and `128 KB + 1` is forbidden by the spec.
 
 This type of block was never generated by the reference compressor.
 
index 9ade7650268b56c5e3a27c12beba0e192acafa28..3196b78dc382d2e6ceea7f2f09319fa146e0ff69 100644 (file)
@@ -1399,7 +1399,7 @@ size_t ZSTD_get_decompressed_size(const void *src, const size_t src_len) {
 /******* END OUTPUT SIZE COUNTING *********************************************/
 
 /******* DICTIONARY PARSING ***************************************************/
-dictionary_t* create_dictionary() {
+dictionary_t* create_dictionary(void) {
     dictionary_t* const dict = calloc(1, sizeof(dictionary_t));
     if (!dict) {
         BAD_ALLOC();
diff --git a/tests/golden-decompression/block-128k.zst b/tests/golden-decompression/block-128k.zst
new file mode 100644 (file)
index 0000000..cdaeae3
Binary files /dev/null and b/tests/golden-decompression/block-128k.zst differ