mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 921215 - Handle being passed NULL ptr for either surface or gl to SharedSurface_IOSurface::Create by returning NULL. r=mattwoodrow
This commit is contained in:
parent
d3041f814e
commit
8fcf8f2e03
@ -18,6 +18,9 @@ using namespace gfx;
|
||||
/* static */ SharedSurface_IOSurface*
|
||||
SharedSurface_IOSurface::Create(MacIOSurface* surface, GLContext *gl, bool hasAlpha)
|
||||
{
|
||||
MOZ_ASSERT(surface);
|
||||
MOZ_ASSERT(gl);
|
||||
|
||||
gfxIntSize size(surface->GetWidth(), surface->GetHeight());
|
||||
return new SharedSurface_IOSurface(surface, gl, size, hasAlpha);
|
||||
}
|
||||
@ -99,6 +102,11 @@ SurfaceFactory_IOSurface::CreateShared(const gfxIntSize& size)
|
||||
RefPtr<MacIOSurface> surf =
|
||||
MacIOSurface::CreateIOSurface(size.width, size.height, 1.0, hasAlpha);
|
||||
|
||||
if (!surf) {
|
||||
NS_WARNING("Failed to create MacIOSurface.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return SharedSurface_IOSurface::Create(surf, mGL, hasAlpha);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user