bugfix: capture fail when surfaceNode no buffer

Signed-off-by: lee <liwei576@huawei.com>
This commit is contained in:
lee 2022-03-24 09:37:21 +08:00
parent 178dd3a854
commit 6fed48f4af

View File

@ -80,6 +80,10 @@ std::unique_ptr<Media::PixelMap> RSSurfaceCaptureTask::CreatePixelMapBySurfaceNo
ROSEN_LOGE("CreatePixelMapBySurfaceNode: node == nullptr");
return nullptr;
}
if (node->GetBuffer() == nullptr) {
ROSEN_LOGE("CreatePixelMapBySurfaceNode: node GetBuffer == nullptr");
return nullptr;
}
int pixmapWidth = node->GetRenderProperties().GetBoundsWidth();
int pixmapHeight = node->GetRenderProperties().GetBoundsHeight();
Media::InitializationOptions opts;