From 71c0318322ce998ea411f343607de524b2058799 Mon Sep 17 00:00:00 2001 From: cku Date: Fri, 28 Apr 2017 11:48:21 +0800 Subject: Bug 1360343 - ensure maskSurface is not null before dereference, since it can be null because of OOM or gfx device reset. r=dvander MozReview-Commit-ID: HX2qsWLZpMg --HG-- extra : rebase_source : 046befc11151461a682842c31e2ce39247a5e1d8 --- layout/svg/nsSVGMaskFrame.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'layout') diff --git a/layout/svg/nsSVGMaskFrame.cpp b/layout/svg/nsSVGMaskFrame.cpp index b8e4b32ae..a22833d61 100644 --- a/layout/svg/nsSVGMaskFrame.cpp +++ b/layout/svg/nsSVGMaskFrame.cpp @@ -274,7 +274,8 @@ nsSVGMaskFrame::GetMaskForMaskedFrame(gfxContext* aContext, } RefPtr maskSurface = maskSnapshot->GetDataSurface(); DataSourceSurface::MappedSurface map; - if (!maskSurface->Map(DataSourceSurface::MapType::READ, &map)) { + if (!maskSurface || + !maskSurface->Map(DataSourceSurface::MapType::READ, &map)) { return nullptr; } -- cgit v1.2.3