Bug 412378 - crash in gfxPlatformGtk::CreateOffscreenSurface() when using xpcshell. r=stuart, a=schrep
authordolske@mozilla.com
Fri, 18 Jan 2008 15:50:24 -0800
changeset 10420 5734d538913f88af9ac70ac1745cc77279badda9
parent 10419 a8e44f7398fa1d8b9a5cae44694d232d581e6ba3
child 10421 c77c234b2ba9f5fdcd23540c73ac7e346e24c9aa
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherderautoland@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstuart, schrep
bugs412378
milestone1.9b3pre
Bug 412378 - crash in gfxPlatformGtk::CreateOffscreenSurface() when using xpcshell. r=stuart, a=schrep
gfx/thebes/src/gfxPlatformGtk.cpp
--- 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.