summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCompress/Deflate.cpp
AgeCommit message (Collapse)Author
2021-04-29Everywhere: Use "the SerenityOS developers." in copyright headersLinus Groh
We had some inconsistencies before: - Sometimes "The", sometimes "the" - Sometimes trailing ".", sometimes no trailing "." I picked the most common one (lowecase "the", trailing ".") and applied it to all copyright headers. By using the exact same string everywhere we can ensure nothing gets missed during a global search (and replace), and that these inconsistencies are not spread any further (as copyright headers are commonly copied to new files).
2021-04-22AK+Userland: Use idan.horowitz@serenityos.org for my copyright headersIdan Horowitz
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-18Everywhere: Fix a bunch of typosLinus Groh
2021-03-19LibCompress: Convert DeflateDecompressor from recursive to iterativeIdan Horowitz
This way a deflate blob that contains a large amount of small blocks wont cause a stack overflow.
2021-03-17LibCompress: fail gracefuly on invalid symbols in DeflateDecompressorIdan Horowitz
2021-03-17LibCompress: Check for impossible back references in DeflateDecompressorIdan Horowitz
This commit makes sure that we fail if an encoded lz77 back reference references bytes that are outside our sliding window, instead of just silently failing, which triggers an assertion down the line.
2021-03-16LibCompress: Fail gracefuly on missing huffman codes in DeflateDecompressorIdan Horowitz
2021-03-16LibCompress: Check and fail for input stream errors in DeflateDecompressorIdan Horowitz
Since we were not checking for error flags set by read_bits we would just always read 0 as the bits' value, which in some edge cases could lead to an infinite loop.
2021-03-16LibCompress+AK: Dont short-circuit error handling propagationIdan Horowitz
In the case that both the stream and the wrapped substream had errors to be handled only one of the two would be resolved due to boolean short circuiting. this commit ensures both are handled irregardless of one another.
2021-03-15LibCompress+AK: Propagate error handling to wrapped streamsIdan Horowitz
This ensures that when a DeflateCompressor stream is cleared of any errors its underlying wrapped streams (InputBitStream/InputMemoryStream) will be cleared as well and wont fail a VERIFY on destruction.
2021-03-14LibCompress: Handle literal only lz77 streams in DeflateCompressorIdan Horowitz
Very incompressible data could sometimes produce no backreferences which would result in no distance huffman code being created (as it was not needed), so VERIFY the code exists only if it is actually needed for writing the stream.
2021-03-13LibCompress: Replace goto with simple recursion in DeflateCompressorIdan Horowitz
This is just a bit easier on the eyes :^)
2021-03-13LibCompress: Implement DEFLATE compressionIdan Horowitz
This commit adds a fully functional DEFLATE compression implementation that can be used to implement compression for higher level formats like gzip, zlib or zip. A large part of this commit is based on Hans Wennborg's great article about the DEFLATE and zip specifications: https://www.hanshq.net/zip.html
2021-03-12Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)Andreas Kling
Good-bye LogStream. Long live AK::Format!
2021-02-26Everywhere: Remove a bunch of redundant 'AK::' namespace prefixesLinus Groh
This is basically just for consistency, it's quite strange to see multiple AK container types next to each other, some with and some without the namespace prefix - we're 'using AK::Foo;' a lot and should leverage that. :^)
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2021-01-22Everywhere: Fix typosLinus Groh
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling