Do not abort if a MultiFrameCodec is unable to allocate a bitmap buffer (flutter/engine#37534)
Fixes https://github.com/flutter/flutter/issues/113014
This commit is contained in:
@@ -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_);
|
||||
|
||||
Reference in New Issue
Block a user