aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkFindAndPlaceGlyph.h
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2016-12-21 17:00:06 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-21 22:29:38 +0000
commit49e59b2df4065d856e4e03d433f2facd2a5548ca (patch)
tree177313e7dff43991c9dfe659180c683f99e779ab /src/core/SkFindAndPlaceGlyph.h
parent4bf98e7e802edf43effec93bea22fecb031f65f1 (diff)
Protect glyph sub-pixel placement against NaN and Inf.
BUG=chromium:675106 Change-Id: I3f8f2575ca3d1b02615be00d66cf7a123407c5a3 Reviewed-on: https://skia-review.googlesource.com/6404 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'src/core/SkFindAndPlaceGlyph.h')
-rw-r--r--src/core/SkFindAndPlaceGlyph.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/SkFindAndPlaceGlyph.h b/src/core/SkFindAndPlaceGlyph.h
index 257528cd03..4e0c9f1dcf 100644
--- a/src/core/SkFindAndPlaceGlyph.h
+++ b/src/core/SkFindAndPlaceGlyph.h
@@ -436,6 +436,9 @@ private:
SkPoint findAndPositionGlyph(
const char** text, SkPoint position, ProcessOneGlyph&& processOneGlyph) override {
+ if (!SkScalarsAreFinite(position.fX, position.fY)) {
+ return position;
+ }
SkPoint finalPosition = position;
if (kTextAlignment != SkPaint::kLeft_Align) {
// Get the width of an un-sub-pixel positioned glyph for calculating the