Bug 412378 - crash in gfxPlatformGtk::CreateOffscreenSurface() when using xpcshell. r=stuart, a=schrep
--- a/gfx/thebes/src/gfxPlatformGtk.cpp
+++ b/gfx/thebes/src/gfxPlatformGtk.cpp
@@ -132,16 +132,19 @@ gfxPlatformGtk::CreateOffscreenSurface(c
default:
return nsnull;
}
// XXX we really need a different interface here, something that passes
// in more context, including the display and/or target surface type that
// we should try to match
Display* display = GDK_DISPLAY();
+ if (!display)
+ return nsnull;
+
if (!UseGlitz()) {
GdkPixmap* pixmap = nsnull;
XRenderPictFormat* xrenderFormat =
XRenderFindStandardFormat(display, xrenderFormatID);
if (!xrenderFormat) {
// We don't have Render; see if we can just create a pixmap
// of the requested depth.