Bug 1019004 - Guard against a null pointer deref when dumping painting. r=BenWa
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 03 Jun 2014 12:59:15 -0400
changeset 205667 828b5db62ed085700089bd7199b8fcb33c0da534
parent 205666 68ba56dc7149cf62ff4c69cadaadd371b33b62c8
child 205668 a0b699f4fddd4053ba38d01413f608c8ca9a16a3
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBenWa
bugs1019004
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1019004 - Guard against a null pointer deref when dumping painting. r=BenWa
gfx/layers/composite/ContainerLayerComposite.cpp
--- a/gfx/layers/composite/ContainerLayerComposite.cpp
+++ b/gfx/layers/composite/ContainerLayerComposite.cpp
@@ -385,17 +385,19 @@ ContainerRender(ContainerT* aContainer,
     // assert it though
   }
 
   if (needsSurface) {
     // Unbind the current surface and rebind the previous one.
 #ifdef MOZ_DUMP_PAINTING
     if (gfxUtils::sDumpPainting) {
       RefPtr<gfx::DataSourceSurface> surf = surface->Dump(aManager->GetCompositor());
-      WriteSnapshotToDumpFile(aContainer, surf);
+      if (surf) {
+        WriteSnapshotToDumpFile(aContainer, surf);
+      }
     }
 #endif
 
     compositor->SetRenderTarget(previousTarget);
     EffectChain effectChain(aContainer);
     LayerManagerComposite::AutoAddMaskEffect autoMaskEffect(aContainer->GetMaskLayer(),
                                                             effectChain,
                                                             !aContainer->GetTransform().CanDraw2D());