aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPaint.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-01-22 16:49:49 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-22 22:33:11 +0000
commit1fe0bcc4f92bfe104bda57aa2ae5d0cb5b4f8c09 (patch)
tree24ffec2976a352ea65128c2583c4b13e7608d272 /src/core/SkPaint.cpp
parentca02c0a464efb6ef1d856d5658b9312fde580cc0 (diff)
check for huge paths
Bug:802976 Change-Id: Ibb5930442f75ca8483afc8dfa5869cac98573904 Reviewed-on: https://skia-review.googlesource.com/98440 Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkPaint.cpp')
-rw-r--r--src/core/SkPaint.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 05e3e360bf..6198aa307b 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -1937,6 +1937,11 @@ bool SkPaint::unflatten(SkReadBuffer& buffer) {
bool SkPaint::getFillPath(const SkPath& src, SkPath* dst, const SkRect* cullRect,
SkScalar resScale) const {
+ if (!src.isFinite()) {
+ dst->reset();
+ return false;
+ }
+
SkStrokeRec rec(*this, resScale);
const SkPath* srcPtr = &src;
@@ -1957,6 +1962,11 @@ bool SkPaint::getFillPath(const SkPath& src, SkPath* dst, const SkRect* cullRect
*dst = *srcPtr;
}
}
+
+ if (!dst->isFinite()) {
+ dst->reset();
+ return false;
+ }
return !rec.isHairlineStyle();
}