Skip to content

Commit

Permalink
Fix initialization of brotli parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
npaun committed Sep 4, 2024
1 parent 71dc488 commit 16aec82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/workerd/api/node/zlib-util.c++
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,6 @@ bool ZlibUtil::BrotliCompressionStream<CompressionContext>::initialize(jsg::Lock
jsg::BufferSource params,
jsg::BufferSource writeResult,
jsg::Function<void()> writeCallback) {
auto results = writeResult.template asArrayPtr<uint32_t>();
this->initializeStream(kj::mv(writeResult), kj::mv(writeCallback));
auto maybeError =
this->context()->initialize(CompressionStream<CompressionContext>::AllocForBrotli,
Expand All @@ -837,6 +836,8 @@ bool ZlibUtil::BrotliCompressionStream<CompressionContext>::initialize(jsg::Lock
return false;
}

auto results = params.template asArrayPtr<uint32_t>();

for (int i = 0; i < results.size(); i++) {
if (results[i] == static_cast<uint32_t>(-1)) {
continue;
Expand Down

0 comments on commit 16aec82

Please sign in to comment.