[Impeller] null check device buffer in image encoding. (#161194)
Fixes https://github.com/flutter/flutter/issues/160652
This commit is contained in:
parent
e0d7b588b6
commit
b515f829af
@ -165,6 +165,12 @@ void ImageEncodingImpeller::ConvertDlImageToSkImage(
|
||||
texture->GetTextureDescriptor().GetByteSizeOfBaseMipLevel();
|
||||
auto buffer =
|
||||
impeller_context->GetResourceAllocator()->CreateBuffer(buffer_desc);
|
||||
if (!buffer) {
|
||||
encode_task(fml::Status(fml::StatusCode::kUnimplemented,
|
||||
"Failed to allocate destination buffer."));
|
||||
return;
|
||||
}
|
||||
|
||||
auto command_buffer = impeller_context->CreateCommandBuffer();
|
||||
command_buffer->SetLabel("BlitTextureToBuffer Command Buffer");
|
||||
auto pass = command_buffer->CreateBlitPass();
|
||||
|
Loading…
x
Reference in New Issue
Block a user