Bug 1332798 - Add null check after CreateIOSurface. r=mstange a=jcristau
authorMorris Tseng <mtseng@mozilla.com>
Thu, 26 Jan 2017 17:07:07 +0800
changeset 366887 cfa727a93b0bd874cf02dd6fd58c0a0353b52105
parent 366886 b42c3703393d1d9192066cb68c136e6189ee437d
child 366888 35b9c31fbd27ef69f59d41c930040053b2240430
push id6881
push usercbook@mozilla.com
push dateMon, 06 Feb 2017 15:50:16 +0000
treeherdermozilla-beta@cc219ce6b182 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, jcristau
bugs1332798
milestone52.0
Bug 1332798 - Add null check after CreateIOSurface. r=mstange a=jcristau MozReview-Commit-ID: 6JIR8y04cXm
widget/cocoa/RectTextureImage.mm
--- a/widget/cocoa/RectTextureImage.mm
+++ b/widget/cocoa/RectTextureImage.mm
@@ -44,16 +44,20 @@ RectTextureImage::BeginUpdate(const Layo
   if (mUpdateRegion.IsEmpty()) {
     return nullptr;
   }
 
   if (!mIOSurface || needRecreate) {
     DeleteTexture();
     mIOSurface = MacIOSurface::CreateIOSurface(mBufferSize.width,
                                                mBufferSize.height);
+
+    if (!mIOSurface) {
+      return nullptr;
+    }
   }
 
   mInUpdate = true;
 
   mIOSurface->Lock(false);
   unsigned char* ioData = (unsigned char*)mIOSurface->GetBaseAddress();
   gfx::IntSize size(mBufferSize.width, mBufferSize.height);
   int32_t stride = mIOSurface->GetBytesPerRow();