Bug 1748438 - Check for null surface in ImageBitmapRenderingContext::GetImageBuffer. r=aosmond

Differential Revision: https://phabricator.services.mozilla.com/D135253
This commit is contained in:
Lee Salzman 2022-01-06 21:12:57 +00:00
parent 6cee5dbd76
commit 4d3a112bae

View File

@ -138,6 +138,9 @@ mozilla::UniquePtr<uint8_t[]> ImageBitmapRenderingContext::GetImageBuffer(
}
RefPtr<gfx::SourceSurface> surface = mImage->GetAsSourceSurface();
if (!surface) {
return nullptr;
}
RefPtr<gfx::DataSourceSurface> data = surface->GetDataSurface();
if (!data) {
return nullptr;