Skip to content

Commit

Permalink
Bug 1870683 - Ensure CanvasChild::EnsureDataSurfaceShmem checks for u…
Browse files Browse the repository at this point in the history
…ninitialized state. r=gfx-reviewers,lsalzman

If we fail to create CanvasChild::mRecorder, we shouldn't attempt to
readback a recording surface that never got created.

Differential Revision: https://phabricator.services.mozilla.com/D196767
  • Loading branch information
aosmond committed Dec 18, 2023
1 parent 52917ac commit 494d196
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gfx/layers/ipc/CanvasChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ already_AddRefed<gfx::DrawTarget> CanvasChild::CreateDrawTarget(

bool CanvasChild::EnsureDataSurfaceShmem(gfx::IntSize aSize,
gfx::SurfaceFormat aFormat) {
if (!mRecorder) {
return false;
}

size_t sizeRequired =
ImageDataSerializer::ComputeRGBBufferSize(aSize, aFormat);
if (!sizeRequired) {
Expand Down

0 comments on commit 494d196

Please sign in to comment.