mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
LibCompress: Write Deflate window size in the Zlib header
Previously we said that the window size was always 512 bytes, which caused errors during decompressing in apps outside of Serenity that actually use this information. Now, the value is always 7 (32 KiB). Fixes: #14503
This commit is contained in:
parent
72a37e5292
commit
693d34fe3d
Notes:
sideshowbarker
2024-07-17 09:33:14 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/693d34fe3d Pull-request: https://github.com/SerenityOS/serenity/pull/14530 Issue: https://github.com/SerenityOS/serenity/issues/14503
@ -84,9 +84,15 @@ ZlibCompressor::~ZlibCompressor()
|
||||
|
||||
void ZlibCompressor::write_header(ZlibCompressionMethod compression_method, ZlibCompressionLevel compression_level)
|
||||
{
|
||||
u8 compression_info = 0;
|
||||
if (compression_method == ZlibCompressionMethod::Deflate) {
|
||||
compression_info = AK::log2(DeflateCompressor::window_size) - 8;
|
||||
VERIFY(compression_info <= 7);
|
||||
}
|
||||
|
||||
ZlibHeader header {
|
||||
.compression_method = compression_method,
|
||||
.compression_info = 0,
|
||||
.compression_info = compression_info,
|
||||
.check_bits = 0,
|
||||
.present_dictionary = false,
|
||||
.compression_level = compression_level,
|
||||
|
Loading…
Reference in New Issue
Block a user