Skip to content

Commit

Permalink
Return if resizing fails (libjxl#3845)
Browse files Browse the repository at this point in the history
Co-authored-by: Sami Boukortt <sboukortt@google.com>
(cherry picked from commit 55fc72b)
  • Loading branch information
mo271 committed Nov 26, 2024
1 parent 7c621cd commit 761482a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/jxl/encode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ JxlEncoderOutputProcessorWrapper::GetBuffer(size_t min_size,
alloc_size = std::min(alloc_size, it->first - position_);
JXL_ENSURE(alloc_size >= min_size);
}
JXL_ENSURE(buffer.owned_data.resize(alloc_size));
JXL_RETURN_IF_ERROR(buffer.owned_data.resize(alloc_size));
has_buffer_ = true;
return JxlOutputProcessorBuffer(buffer.owned_data.data(), alloc_size, 0,
this);
Expand Down

0 comments on commit 761482a

Please sign in to comment.