Fix crash test draft
authorEthan Lin <ethlin@mozilla.com>
Fri, 18 Aug 2017 17:46:51 +0800
changeset 648792 8b49f8e87b71e2dcdd4fe0ea5f429cbaaece6b79
parent 648791 294bfe90e3ac33beccdf0d3fa88c8216a3abadea
child 648793 7684927c79a64747e44a26f2951ce4c11f86d693
child 648794 c13bca9e6abb76bdcbace67e9a68ee930f01aafe
push id74883
push userbmo:ethlin@mozilla.com
push dateFri, 18 Aug 2017 09:52:39 +0000
milestone57.0a1
Fix crash test MozReview-Commit-ID: 8GZXW8Qa34H
dom/canvas/CanvasRenderingContext2D.cpp
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -6301,16 +6301,20 @@ CanvasRenderingContext2D::InitializeCanv
   data.mPreTransCallbackData = this;
   data.mDidTransCallback = CanvasRenderingContext2DUserData::DidTransactionCallback;
   data.mDidTransCallbackData = this;
 
   if (!mBufferProvider) {
     // Force the creation of a buffer provider.
     EnsureTarget();
     ReturnTarget();
+    if (!mBufferProvider) {
+      MarkContextClean();
+      return false;
+    }
   }
 
   if (mIsSkiaGL) {
       GLuint skiaGLTex = SkiaGLTex();
       if (skiaGLTex) {
         SkiaGLGlue* glue = gfxPlatform::GetPlatform()->GetSkiaGLGlue();
         MOZ_ASSERT(glue);
         data.mGLContext = glue->GetGLContext();