diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp index 50555ef4f5..ba5442eaad 100644 --- a/src/core/SkDevice.cpp +++ b/src/core/SkDevice.cpp @@ -305,6 +305,11 @@ bool SkBaseDevice::peekPixels(SkPixmap* pmap) { void SkBaseDevice::drawGlyphRunRSXform(SkGlyphRun* run, const SkRSXform* xform) { const SkMatrix originalCTM = this->ctm(); + if (!originalCTM.isFinite() || !SkScalarIsFinite(run->paint().getTextSize()) || + !SkScalarIsFinite(run->paint().getTextScaleX()) || + !SkScalarIsFinite(run->paint().getTextSkewX())) { + return; + } sk_sp shader = sk_ref_sp(run->mutablePaint()->getShader()); auto perGlyph = [this, &xform, &originalCTM, shader] ( SkGlyphRun* glyphRun, SkPaint* runPaint) {