Bug 1638873: Check buffer is good before reading next event after checkpoint in CanvasEventRingBuffer::ReadNextEvent. r=jrmuizel
authorBob Owen <bobowencode@gmail.com>
Wed, 20 May 2020 20:08:20 +0000
changeset 531406 8e9afbc5d9482ea18ca4b9dd4be9173eef478db0
parent 531405 106dc3f2e4417b54693cb4c447c4a5b50c32092a
child 531407 06c02224ce5df7b44b706371696703968b206167
push id116631
push userbobowencode@gmail.com
push dateThu, 21 May 2020 07:38:07 +0000
treeherderautoland@8e9afbc5d948 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1638873
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 1638873: Check buffer is good before reading next event after checkpoint in CanvasEventRingBuffer::ReadNextEvent. r=jrmuizel Differential Revision: https://phabricator.services.mozilla.com/D75812
gfx/layers/CanvasDrawEventRecorder.cpp
--- a/gfx/layers/CanvasDrawEventRecorder.cpp
+++ b/gfx/layers/CanvasDrawEventRecorder.cpp
@@ -325,17 +325,17 @@ bool CanvasEventRingBuffer::WaitForDataT
   }
 
   return false;
 }
 
 int32_t CanvasEventRingBuffer::ReadNextEvent() {
   int32_t nextEvent;
   ReadElement(*this, nextEvent);
-  while (nextEvent == kCheckpointEventType) {
+  while (nextEvent == kCheckpointEventType && good()) {
     ReadElement(*this, nextEvent);
   }
 
   return nextEvent;
 }
 
 uint32_t CanvasEventRingBuffer::CreateCheckpoint() {
   WriteElement(*this, kCheckpointEventType);