Bug 1331274 - aPath coming into Fill method may not be valid. r=kechen, a=gchang
authorMilan Sreckovic <milan@mozilla.com>
Mon, 16 Jan 2017 13:21:36 -0500
changeset 357220 dd4b8065a9a9ba168c84674bcd4071b0b4a8b7b0
parent 357219 84a38c1c11a687e63bb6a5ee0f4ffc7d232374f9
child 357221 8e692dd4176cba81ce020b29ae8b352dc1db724a
push id6793
push userryanvm@gmail.com
push dateWed, 18 Jan 2017 18:09:13 +0000
treeherdermozilla-beta@dd4b8065a9a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskechen, gchang
bugs1331274
milestone51.0
Bug 1331274 - aPath coming into Fill method may not be valid. r=kechen, a=gchang CLOSED TREE MozReview-Commit-ID: 5tmGUXEFJlw
gfx/2d/DrawTargetD2D1.cpp
gfx/2d/DrawTargetSkia.cpp
--- a/gfx/2d/DrawTargetD2D1.cpp
+++ b/gfx/2d/DrawTargetD2D1.cpp
@@ -495,17 +495,17 @@ DrawTargetD2D1::Stroke(const Path *aPath
   FinalizeDrawing(aOptions.mCompositionOp, aPattern);
 }
 
 void
 DrawTargetD2D1::Fill(const Path *aPath,
                      const Pattern &aPattern,
                      const DrawOptions &aOptions)
 {
-  if (aPath->GetBackendType() != BackendType::DIRECT2D1_1) {
+  if (!aPath || aPath->GetBackendType() != BackendType::DIRECT2D1_1) {
     gfxDebug() << *this << ": Ignoring drawing call for incompatible path.";
     return;
   }
   const PathD2D *d2dPath = static_cast<const PathD2D*>(aPath);
 
   PrepareForDrawing(aOptions.mCompositionOp, aPattern);
 
   mDC->SetAntialiasMode(D2DAAMode(aOptions.mAntialiasMode));
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
@@ -729,17 +729,17 @@ DrawTargetSkia::StrokeLine(const Point &
 }
 
 void
 DrawTargetSkia::Fill(const Path *aPath,
                     const Pattern &aPattern,
                     const DrawOptions &aOptions)
 {
   MarkChanged();
-  if (aPath->GetBackendType() != BackendType::SKIA) {
+  if (!aPath || aPath->GetBackendType() != BackendType::SKIA) {
     return;
   }
 
   const PathSkia *skiaPath = static_cast<const PathSkia*>(aPath);
 
   AutoPaintSetup paint(mCanvas.get(), aOptions, aPattern);
 
   if (!skiaPath->GetPath().isFinite()) {