Bug 1326292 - Add null check of drawTarget in WinCompositorWidget.cpp, to avoid crash. r=jimm a=gchang
authorTracy Walker <twalker@mozilla.com>
Wed, 08 Feb 2017 09:06:49 -0600
changeset 376115 88fc184793213bd139b752681ac51a057d4b48d5
parent 376114 6512b480a90a200db2208c9c46902a66477a8678
child 376116 46116604aa0b07bffac9c4c27e19f27805e56883
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, gchang
bugs1326292
milestone53.0a2
Bug 1326292 - Add null check of drawTarget in WinCompositorWidget.cpp, to avoid crash. r=jimm a=gchang
widget/windows/WinCompositorWidget.cpp
--- a/widget/windows/WinCompositorWidget.cpp
+++ b/widget/windows/WinCompositorWidget.cpp
@@ -277,16 +277,19 @@ WinCompositorWidget::ClearTransparentWin
   }
 
   EnsureTransparentSurface();
 
   IntSize size = mTransparentSurface->GetSize();
   if (!size.IsEmpty()) {
     RefPtr<DrawTarget> drawTarget =
       gfxPlatform::CreateDrawTargetForSurface(mTransparentSurface, size);
+    if (!drawTarget) {
+      return;
+    }
     drawTarget->ClearRect(Rect(0, 0, size.width, size.height));
     RedrawTransparentWindow();
   }
 }
 
 bool
 WinCompositorWidget::RedrawTransparentWindow()
 {