aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPathMeasure.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-04-19 11:30:18 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-19 16:07:14 +0000
commitc4e384e5ad85250920cac6e8ee0e2a14b69d67e0 (patch)
tree2c933cc63d7d99db27ab0108bc4bbb818e54fc6f /src/core/SkPathMeasure.cpp
parent4b5e4b3f93137f00c153fba414b5b8ff53321b1c (diff)
check if we fail to eval the conic in pathmeasure
Bug: oss-fuzz:7201 Change-Id: I9d40225b7827239d2a229dc056f7f2caa8a4eb31 Reviewed-on: https://skia-review.googlesource.com/122420 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkPathMeasure.cpp')
-rw-r--r--src/core/SkPathMeasure.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/SkPathMeasure.cpp b/src/core/SkPathMeasure.cpp
index 4ddb5a5c53..905c176b40 100644
--- a/src/core/SkPathMeasure.cpp
+++ b/src/core/SkPathMeasure.cpp
@@ -258,6 +258,9 @@ SkScalar SkPathMeasure::compute_conic_segs(const SkConic& conic, SkScalar distan
int maxt, const SkPoint& maxPt, unsigned ptIndex) {
int halft = (mint + maxt) >> 1;
SkPoint halfPt = conic.evalAt(tValue2Scalar(halft));
+ if (!halfPt.isFinite()) {
+ return 0;
+ }
if (tspan_big_enough(maxt - mint) && conic_too_curvy(minPt, halfPt, maxPt)) {
distance = this->compute_conic_segs(conic, distance, mint, minPt, halft, halfPt, ptIndex);
distance = this->compute_conic_segs(conic, distance, halft, halfPt, maxt, maxPt, ptIndex);