summaryrefslogtreecommitdiff
path: root/layout
diff options
context:
space:
mode:
authorcku <cku@mozilla.com>2017-04-28 11:48:21 +0800
committeryami <34216515+kn-yami@users.noreply.github.com>2019-04-03 14:55:35 +0200
commit765ab730092ac62526dc595c5f729a186d27ebbc (patch)
tree29cff490491c44f33ab40aaef4182514495048aa /layout
parent1179d56493a05767cd836a616dcbd624a22e0381 (diff)
downloaduxp-765ab730092ac62526dc595c5f729a186d27ebbc.tar.gz
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
Diffstat (limited to 'layout')
-rw-r--r--layout/svg/nsSVGMaskFrame.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/layout/svg/nsSVGMaskFrame.cpp b/layout/svg/nsSVGMaskFrame.cpp
index b8e4b32ae9..a22833d61a 100644
--- a/layout/svg/nsSVGMaskFrame.cpp
+++ b/layout/svg/nsSVGMaskFrame.cpp
@@ -274,7 +274,8 @@ nsSVGMaskFrame::GetMaskForMaskedFrame(gfxContext* aContext,
}
RefPtr<DataSourceSurface> maskSurface = maskSnapshot->GetDataSurface();
DataSourceSurface::MappedSurface map;
- if (!maskSurface->Map(DataSourceSurface::MapType::READ, &map)) {
+ if (!maskSurface ||
+ !maskSurface->Map(DataSourceSurface::MapType::READ, &map)) {
return nullptr;
}