From 45d2b32ff18e1ee92aa96301187af06ce8d294fa Mon Sep 17 00:00:00 2001 From: Bob Owen Date: Mon, 22 Jan 2024 16:38:53 +0000 Subject: [PATCH] Bug 1875656: Make CanvasTranslator::AddBuffer diagnostic assert instead of release. r=aosmond,gfx-reviewers Differential Revision: https://phabricator.services.mozilla.com/D199222 --- gfx/layers/ipc/CanvasTranslator.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gfx/layers/ipc/CanvasTranslator.cpp b/gfx/layers/ipc/CanvasTranslator.cpp index 1851614b6b06a..4a36e2a87e4ed 100644 --- a/gfx/layers/ipc/CanvasTranslator.cpp +++ b/gfx/layers/ipc/CanvasTranslator.cpp @@ -231,7 +231,14 @@ void CanvasTranslator::AddBuffer(ipc::SharedMemoryBasic::Handle&& aBufferHandle, return; } - MOZ_RELEASE_ASSERT(mHeader->readerState == State::Paused); + if (mHeader->readerState != State::Paused) { + gfxCriticalNote << "CanvasTranslator::AddBuffer bad state " + << uint32_t(State(mHeader->readerState)); + MOZ_DIAGNOSTIC_ASSERT(false, "mHeader->readerState == State::Paused"); + Deactivate(); + return; + } + MOZ_ASSERT(mDefaultBufferSize != 0); // Check and signal the writer when we finish with a buffer, because it