aboutsummaryrefslogtreecommitdiff
path: root/lib/std/compress/zstandard/decode
AgeCommit message (Collapse)Author
2025-07-25std: rework zstd for new I/O APIAndrew Kelley
This passes tests but it doesn't provide as big a window size as is required to decompress larger streams. The next commit in this branch will work towards that, without introducing an additional buffer.
2025-03-31std.compress.zstd: fix OOB access in literal decodedweiller
When decoding the literals section of a compressed block, the length of the regenerated size of the literals must be checked against the buffer literals are decoded into.
2024-10-13Rewrite bit_reader and bit_writer to take advantage of current zig semantics ↵tgschultz
and enhance readability (#21689) Co-authored-by: Tanner Schultz <tgschultz@tgschultz-dl.tail7ba92.ts.net>
2023-11-19lib: correct unnecessary uses of 'var'mlugg
2023-11-10zstandard: fix division by zero when using RingBufferdweiller
This change fixes some division-by-zero bugs introduced by the optimized ring buffer read/write functions in d8c067966. There are edge cases where decompression can use a length zero ring buffer as the size of the ring buffer used is exactly the the window size specified by a Zstandard frame, and this can be zero. Switching away from loops to mem copies means that we need to ensure ring buffers do not have length zero ring when attempting to read/write from them.
2023-11-03zstandard: fix incorrect RLE decompression into ring bufferdweiller
This reverts a change introduced in #17400 causing a bug when decompressing an RLE block into a ring buffer. RLE blocks contain only a single byte of data to copy into the output, so attempting to copy a slice causes buffer overruns and incorrect decompression.
2023-10-31std.builtin.Endian: make the tags lower caseAndrew Kelley
Let's take this breaking change opportunity to fix the style of this enum.
2023-10-31mem: fix ub in writeIntJacob Young
Use inline to vastly simplify the exposed API. This allows a comptime-known endian parameter to be propogated, making extra functions for a specific endianness completely unnecessary.
2023-10-21 compress: Improve RingBuffer usagejoadnacer
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2023-06-19all: zig fmt and rename "@XToY" to "@YFromX"Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-05-23std.sort: add pdqsort and heapsortAli Chraghi
2023-04-28update codebase to use `@memset` and `@memcpy`Andrew Kelley
2023-04-23Improvements to docs and textzooster
* docs(std.math): elaborate on difference between absCast and absInt * docs(std.rand.Random.weightedIndex): elaborate on likelihood I think this makes it easier to understand. * langref: add small reminder * docs(std.fs.path.extension): brevity * docs(std.bit_set.StaticBitSet): mention the specific types * std.debug.TTY: explain what purpose this struct serves This should also make it clearer that this struct is not supposed to provide unrelated terminal manipulation functionality such as setting the cursor position or something because terminals are complicated and we should keep this struct simple and focused on debugging. * langref(package listing): brevity * langref: explain what exactly `threadlocal` causes to happen * std.array_list: link between swapRemove and orderedRemove Maybe this can serve as a TLDR and make it easier to decide. * PrefetchOptions.locality: clarify docs that this is a range This confused me previously and I thought I can only use either 0 or 3. * fix typos and more * std.builtin.CallingConvention: document some CCs * langref: explain possibly cryptic names I think it helps knowing what exactly these acronyms (@clz and @ctz) and abbreviations (@popCount) mean. * variadic function error: add missing preposition * std.fmt.format docs: nicely hyphenate * help menu: say what to optimize for I think this is slightly more specific than just calling it "optimizations". These are speed optimizations. I used the word "performance" here.
2023-02-21std.compress.zstandard: fix error sets for streaming APIdweiller
2023-02-21std.RingBuffer: add (non-concurrent) RingBuffer implementationdweiller
2023-02-20std.compress.zstandard: update for multi-for-loop changedweiller
2023-02-20std.compress.zstandard: also check block size when sequence count is 0dweiller
2023-02-20std.compress.zstandard: add error condition to ring buffer decodingdweiller
Previously `executeSequenceRingBuffer()` would not verify the offset against the number of bytes already decoded, so it would happily copy garbage bytes rather than return an error before the window was filled. To fix this a new `written_count` is added to the decode state that tracks the total number of bytes decoded.
2023-02-20std.compress.zstandard: fix erroneous literal stream empty checksdweiller
2023-02-20std.compress.zstandard: remove unneeded branchdweiller
2023-02-20std.compress.zstandard: check FSE bitstreams are fully consumeddweiller
2023-02-20std.compress.zstandard: bytes read assert to error in decodeBlockReaderdweiller
2023-02-20std.compress.zstandard: cleanup high-level api docs and error setsdweiller
2023-02-20std.compress.zstandard: fix errors and crashes in ZstandardStreamdweiller
2023-02-20std.compress.zstandard: error when FSE bitstream is no fully consumeddweiller
2023-02-20std.compress.zstandard: improve block size validationdweiller
2023-02-20std.compress.zstandard: verify content size and fix crashdweiller
2023-02-20std.compress.zstandard: fix fse decoding crashdweiller
2023-02-20std.compress.zstandard: fix crashesdweiller
2023-02-20std.compress.zstandard: fix crashesdweiller
2023-02-20std.compress.zstandard: fix capitalisation of Zstandarddweiller
2023-02-20std.compress.zstandard: improve doc commentsdweiller
2023-02-20std.compress.zstandard: split decompressor into multiple filesdweiller