Bug 1337790 - Fix null pointer dereference when a frame has no surface and one is requested. r=me
authorAndrew Osmond <aosmond@mozilla.com>
Wed, 08 Feb 2017 10:51:08 -0500
changeset 390466 6a43afeeced35151314142528d28e33f5f9aa657
parent 390465 fb66941fca4727647218e98faef001e57d632338
child 390467 168f923ea6e7e76eb2cb587cd47161a77ca1bcd6
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1337790
milestone54.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 1337790 - Fix null pointer dereference when a frame has no surface and one is requested. r=me
image/imgFrame.cpp
--- a/image/imgFrame.cpp
+++ b/image/imgFrame.cpp
@@ -774,16 +774,20 @@ imgFrame::GetSourceSurfaceInternal()
     }
   }
 
   if (mLockedSurface) {
     RefPtr<SourceSurface> surf(mLockedSurface);
     return surf.forget();
   }
 
+  if (!mRawSurface) {
+    return nullptr;
+  }
+
   return CreateLockedSurface(mRawSurface, mFrameRect.Size(), mFormat);
 }
 
 AnimationData
 imgFrame::GetAnimationData() const
 {
   MonitorAutoLock lock(mMonitor);
   MOZ_ASSERT(mLockCount > 0, "Image data should be locked");