Bug 1308090, r=jrmuizel a=ritu FIREFOX_50_0b8_BUILD1 FIREFOX_50_0b8_RELEASE
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 06 Oct 2016 15:59:15 +0100
changeset 428860 b7adb2f10487f6f886e047670ba720a248edcb44
parent 428859 7685b4f9ab3f70a0bbd7693a6df01c871fea9cd2
child 428861 62da552138459e86a7c25b1f2836e410454c5e5c
push id33416
push userpaul@paul.cx
push dateMon, 24 Oct 2016 16:26:20 +0000
reviewersjrmuizel, ritu
bugs1308090
milestone50.0
Bug 1308090, r=jrmuizel a=ritu MozReview-Commit-ID: A0wlb1qtk9r
dom/canvas/ImageBitmap.cpp
--- a/dom/canvas/ImageBitmap.cpp
+++ b/dom/canvas/ImageBitmap.cpp
@@ -819,16 +819,20 @@ ImageBitmap::CreateInternal(nsIGlobalObj
 
   if (!container) {
     aRv.Throw(NS_ERROR_NOT_AVAILABLE);
     return nullptr;
   }
 
   AutoLockImage lockImage(container);
   layers::Image* data = lockImage.GetImage();
+  if (!data) {
+    aRv.Throw(NS_ERROR_NOT_AVAILABLE);
+    return nullptr;
+  }
   RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data);
 
   // Set the picture rectangle.
   if (ret && aCropRect.isSome()) {
     ret->SetPictureRect(aCropRect.ref(), aRv);
   }
 
   // Set mIsCroppingAreaOutSideOfSourceImage.