Only return a valid RotatedBuffer in ContentClientBasic::CreateBuffer (bug 1416790, r=dvander a=gchang)
authorRyan Hunt <rhunt@eqrion.net>
Mon, 13 Nov 2017 12:52:31 -0500
changeset 444819 a706ed0c3235f882f8476c83290364d509b458aa
parent 444818 1ec9ad9a1be29b87779b9f5b895ca6d175009f5f
child 444820 645141391be71853e7a7dff8913f4df685b3ffb6
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander, gchang
bugs1416790
milestone58.0
Only return a valid RotatedBuffer in ContentClientBasic::CreateBuffer (bug 1416790, r=dvander a=gchang) MozReview-Commit-ID: C5l4OHAWBLL
gfx/layers/client/ContentClient.cpp
--- a/gfx/layers/client/ContentClient.cpp
+++ b/gfx/layers/client/ContentClient.cpp
@@ -611,16 +611,20 @@ ContentClientBasic::CreateBuffer(gfxCont
 #endif
 
   if (!drawTarget) {
     drawTarget = gfxPlatform::GetPlatform()->CreateDrawTargetForBackend(
       mBackend, size,
       gfxPlatform::GetPlatform()->Optimal2DFormatForContent(aType));
   }
 
+  if (!drawTarget) {
+    return nullptr;
+  }
+
   return new DrawTargetRotatedBuffer(drawTarget, nullptr, aRect, IntPoint(0,0));
 }
 
 RefPtr<CapturedPaintState>
 ContentClientBasic::BorrowDrawTargetForRecording(ContentClient::PaintState& aPaintState,
                                                  RotatedBuffer::DrawIterator* aIter,
                                                  bool aSetTransform)
 {