Bug 1639675: Check that ScopedMap successfully mapped in RecordedPrepareDataForSurface::PlayCanvasEvent. r=mattwoodrow
authorBob Owen <bobowencode@gmail.com>
Thu, 21 May 2020 00:05:47 +0000
changeset 531390 06c02224ce5df7b44b706371696703968b206167
parent 531389 8e9afbc5d9482ea18ca4b9dd4be9173eef478db0
child 531391 e1a8383cf9f9d914a35efd6298e3c7990e1e37f7
push id37439
push userbtara@mozilla.com
push dateThu, 21 May 2020 21:49:34 +0000
treeherdermozilla-central@92c11f0bf14b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1639675
milestone78.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 1639675: Check that ScopedMap successfully mapped in RecordedPrepareDataForSurface::PlayCanvasEvent. r=mattwoodrow Differential Revision: https://phabricator.services.mozilla.com/D76210
gfx/layers/RecordedCanvasEventImpl.h
--- a/gfx/layers/RecordedCanvasEventImpl.h
+++ b/gfx/layers/RecordedCanvasEventImpl.h
@@ -297,16 +297,20 @@ inline bool RecordedPrepareDataForSurfac
     dataSurface = surface->GetDataSurface();
     if (!dataSurface) {
       return false;
     }
   }
 
   auto preparedMap = MakeUnique<gfx::DataSourceSurface::ScopedMap>(
       dataSurface, gfx::DataSourceSurface::READ);
+  if (!preparedMap->IsMapped()) {
+    return false;
+  }
+
   aTranslator->SetPreparedMap(mSurface, std::move(preparedMap));
 
   return true;
 }
 
 template <class S>
 void RecordedPrepareDataForSurface::Record(S& aStream) const {
   WriteElement(aStream, mSurface);