[Webkit-unassigned] [Bug 254021] New: Using CompressionStream to compress large buffers produces invalid data
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Mar 16 07:17:08 PDT 2023
https://bugs.webkit.org/show_bug.cgi?id=254021
Bug ID: 254021
Summary: Using CompressionStream to compress large buffers
produces invalid data
Product: WebKit
Version: Safari Technology Preview
Hardware: Mac (Apple Silicon)
OS: macOS 12
Status: NEW
Severity: Normal
Priority: P2
Component: WebCore Misc.
Assignee: webkit-unassigned at lists.webkit.org
Reporter: bzugmeyer at gmail.com
I am testing the new `CompressionStream` API in Safari Technology Preview. When trying to compress a moderately large buffer, the data it produces seems invalid.
To reproduce:
Compress a large enough buffer of non-repeating data. In the following example, I use a buffer of approximately 48kB. Functions are coming from the WebKit CompressionStream test suite[1]:
const input = new TextEncoder().encode(
JSON.stringify(Array.from({ length: 10_000 }, (_, i) => i))
);
const output = await compressArrayBuffer(input, "deflate");
assert_array_equals(input, pako.inflate(output));
Expected:
`pako.inflate` returns a buffer equal to the input buffer.
Actual:
The decompression fails with `pako.inflate` returning `undefined`.
Notes:
With this particular example, I noticed that it works correctly when compressing up to 35_578 bytes. The issue only occurs when I try to compress more bytes (>= 35_579).
Please see this page[2] for a practical way to reproduce the issue. In Chrome, every test succeed, but in Safari tests with larger inputs are failing.
[1]: https://github.com/WebKit/WebKit/blob/20329b62061b40d5a423a1d75b67779945b84729/LayoutTests/imported/w3c/web-platform-tests/compression/compression-stream.tentative.any.js
[2]: https://safari-compressionstream-issue.benoitzugmeyer.repl.co
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230316/a4f7d9f8/attachment.htm>
More information about the webkit-unassigned
mailing list