mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 17:44:56 +09: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: 693d34fe3d
Pull-request: https://github.com/SerenityOS/serenity/pull/14530
Issue: https://github.com/SerenityOS/serenity/issues/14503
1 changed files with 7 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue