зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1615851 - layer::Image::GetAsSourceSurface is fallible. r=lsalzman
This fixes a crash, where we expected it to be infallible. Differential Revision: https://phabricator.services.mozilla.com/D63005 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
839d86eece
Коммит
cc0f990650
|
@ -615,6 +615,12 @@ UniquePtr<ImageBitmapCloneData> ImageBitmap::ToCloneData() const {
|
|||
result->mPictureRect = mPictureRect;
|
||||
result->mAlphaType = mAlphaType;
|
||||
RefPtr<SourceSurface> surface = mData->GetAsSourceSurface();
|
||||
if (!surface) {
|
||||
// It might just not be possible to get/map the surface. (e.g. from another
|
||||
// process)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
result->mSurface = surface->GetDataSurface();
|
||||
MOZ_ASSERT(result->mSurface);
|
||||
result->mWriteOnly = mWriteOnly;
|
||||
|
|
Загрузка…
Ссылка в новой задаче