Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Do not abort if a MultiFrameCodec is unable to allocate a bitmap buffer
  • Loading branch information
jason-simmons committed Nov 17, 2022
commit e2f419702024f0cf707ac137967304fd8a606273
6 changes: 5 additions & 1 deletion lib/ui/painting/multi_frame_codec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ sk_sp<DlImage> MultiFrameCodec::State::GetNextFrameImage(
SkImageInfo updated = info.makeAlphaType(kPremul_SkAlphaType);
info = updated;
}
bitmap.allocPixels(info);
if (!bitmap.tryAllocPixels(info)) {
FML_LOG(ERROR) << "Failed to allocate memory for bitmap of size "
<< info.computeMinByteSize() << "B";
return nullptr;
}

ImageGenerator::FrameInfo frameInfo =
generator_->GetFrameInfo(nextFrameIndex_);
Expand Down