From bd88b9118f1a87311a1992644a91f6ea6198d0c2 Mon Sep 17 00:00:00 2001 From: Brad Werth Date: Fri, 8 Sep 2023 15:14:45 +0000 Subject: [PATCH] Bug 1851861 Part 2: Add a null-check at another callsite of CreateOffsetDrawTarget. r=gfx-reviewers,lsalzman Differential Revision: https://phabricator.services.mozilla.com/D187730 --- gfx/2d/RecordedEventImpl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gfx/2d/RecordedEventImpl.h b/gfx/2d/RecordedEventImpl.h index fbbd82652c41..54a8ecd72d35 100644 --- a/gfx/2d/RecordedEventImpl.h +++ b/gfx/2d/RecordedEventImpl.h @@ -2132,6 +2132,9 @@ inline bool RecordedCreateDrawTargetForFilter::PlayEvent( RefPtr newDT = dt->CreateSimilarDrawTarget(transformedRect.Size(), mFormat); + if (!newDT) { + return false; + } newDT = gfx::Factory::CreateOffsetDrawTarget(newDT, transformedRect.TopLeft());