Bug 1966676 - Check for pattern surface before accessing offset. r=aosmond, a=RyanVM

Differential Revision: https://phabricator.services.mozilla.com/D258034
This commit is contained in:
Lee Salzman
2025-07-21 17:30:59 +00:00
committed by rvandermeulen@mozilla.com
parent e777d12072
commit 09c5fac79d

View File

@@ -589,7 +589,9 @@ static void SetPaintPattern(SkPaint& aPaint, const Pattern& aPattern,
case PatternType::SURFACE: {
const SurfacePattern& pat = static_cast<const SurfacePattern&>(aPattern);
Matrix offsetMatrix = pat.mMatrix;
offsetMatrix.PreTranslate(pat.mSurface->GetRect().TopLeft());
if (pat.mSurface) {
offsetMatrix.PreTranslate(pat.mSurface->GetRect().TopLeft());
}
sk_sp<SkImage> image =
GetSkImageForSurface(pat.mSurface, &aLock, aBounds, &offsetMatrix);
if (!image) {