mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
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
This commit is contained in:
parent
256a94d778
commit
f9ae2860ab
2 changed files with 5 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue