Bug 1230929 - modified the logic in order to prvent null pointer dereference. r=jmuizelaar

This commit is contained in:
Bogdan Postelnicu 2015-12-07 07:36:00 +01:00
parent 5618fa2eef
commit e672896cef

View File

@ -208,9 +208,10 @@ void
gfxASurface::Init(cairo_surface_t* surface, bool existingSurface)
{
SetSurfaceWrapper(surface, this);
MOZ_ASSERT(surface, "surface should be a valid pointer");
mSurface = surface;
mSurfaceValid = surface && !cairo_surface_status(surface);
mSurfaceValid = !cairo_surface_status(surface);
if (!mSurfaceValid) {
gfxWarning() << "ASurface Init failed with Cairo status " << cairo_surface_status(surface) << " on " << hexa(surface);
}