Bug 1360343 - ensure maskSurface is not null before dereference, since it can be null because of OOM or gfx device reset.
This commit is contained in:
parent
e26c5e1e50
commit
58d35590d4
|
@ -488,6 +488,9 @@ public:
|
|||
/**
|
||||
* Returns a DataSourceSurface with the same data as this one, but
|
||||
* guaranteed to have surface->GetType() == SurfaceType::DATA.
|
||||
*
|
||||
* The returning surface might be null, because of OOM or gfx device reset.
|
||||
* The caller needs to do null-check before using it.
|
||||
*/
|
||||
virtual already_AddRefed<DataSourceSurface> GetDataSurface() override;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue