diff --git a/gfx/thebes/gfxASurface.cpp b/gfx/thebes/gfxASurface.cpp index a4b7e8d93d5..2af66f7d4f5 100644 --- a/gfx/thebes/gfxASurface.cpp +++ b/gfx/thebes/gfxASurface.cpp @@ -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); }