Bug 1308090, r=jrmuizel
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 06 Oct 2016 15:59:15 +0100
changeset 317859 3e30051824704f61374030a645c5be6219d2e201
parent 317858 6359c12a6399b356da32d77cb2416a387c475844
child 317860 4e4969c65834d0a4ec5f3b9c01fc01b6f2d6dc8e
push id33170
push usercbook@mozilla.com
push dateFri, 14 Oct 2016 10:37:07 +0000
treeherderautoland@0d101ebfd95c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1308090
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1308090, r=jrmuizel MozReview-Commit-ID: A0wlb1qtk9r
dom/canvas/ImageBitmap.cpp
--- a/dom/canvas/ImageBitmap.cpp
+++ b/dom/canvas/ImageBitmap.cpp
@@ -821,16 +821,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.