More valid input checking for text

Bug: oss-fuzz: 10620
Change-Id: Ied2acba93719691d9fb889a25936b1ceded75d3f
Reviewed-on: https://skia-review.googlesource.com/156580
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
Jim Van Verth 2018-09-24 16:13:58 -04:00 committed by Skia Commit-Bot
parent 39e1d13d35
commit 87a301158d

View File

@ -1616,7 +1616,15 @@ void SkGpuDevice::drawGlyphRunList(const SkGlyphRunList& glyphRunList) {
GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawGlyphRunList", fContext.get());
SkDEBUGCODE(this->validate();)
fRenderTargetContext->drawGlyphRunList(this->clip(), this->ctm(), glyphRunList);
// Check for valid input
const SkMatrix& ctm = this->ctm();
const SkPaint& paint = glyphRunList.paint();
if (!ctm.isFinite() || !SkScalarIsFinite(paint.getTextSize()) ||
!SkScalarIsFinite(paint.getTextScaleX()) || !SkScalarIsFinite(paint.getTextSkewX())) {
return;
}
fRenderTargetContext->drawGlyphRunList(this->clip(), ctm, glyphRunList);
}
///////////////////////////////////////////////////////////////////////////////