Bug 775228. r=joe a=akeybl
authorMatt Woodrow <mwoodrow@mozilla.com>
Thu, 25 Oct 2012 12:04:41 +1300
changeset 82083 d51c1344f90cd61b99fd6beabef58738a915baf2
parent 82082 d5505b3df3c3e9667b97bed33e1bab446a44f65e
child 82084 46a00740eb8a8165ceb7727516c63021182bd7a4
push id335
push usermwoodrow@mozilla.com
push dateTue, 13 Nov 2012 19:48:28 +0000
reviewersjoe, akeybl
bugs775228
milestone10.0.11esrpre
Bug 775228. r=joe a=akeybl
gfx/thebes/gfxQuartzSurface.cpp
--- a/gfx/thebes/gfxQuartzSurface.cpp
+++ b/gfx/thebes/gfxQuartzSurface.cpp
@@ -155,17 +155,17 @@ PRInt32 gfxQuartzSurface::GetDefaultCont
                gfxContext::FLAG_DISABLE_COPY_BACKGROUND;
 
     return 0;
 }
 
 already_AddRefed<gfxImageSurface> gfxQuartzSurface::GetAsImageSurface()
 {
     cairo_surface_t *surface = cairo_quartz_surface_get_image(mSurface);
-    if (!surface)
+    if (!surface || cairo_surface_status(surface))
         return nsnull;
 
     nsRefPtr<gfxASurface> img = Wrap(surface);
 
     // cairo_quartz_surface_get_image returns a referenced image, and thebes
     // shares the refcounts of Cairo surfaces. However, Wrap also adds a
     // reference to the image. We need to remove one of these references
     // explicitly so we don't leak.