aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPathMeasure.cpp
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-03-19 08:29:46 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-19 13:25:25 +0000
commita7d661a6813924d73319a1d7f0cf0a5cb5343c50 (patch)
tree751b42dbf20adb5ad2ded00629dddb83d3474464 /src/core/SkPathMeasure.cpp
parentccbe40017466a9260e8409b9313c4852504f8d11 (diff)
fix fuzz
if built path is empty, don't add a zero-length line (when start and end of interval are equal) R=kjlubick@google.com Docs-Preview: https://skia.org/?cl=114940 Bug: skia: Change-Id: I018eaec4d31daf3e3820641127b63d047e4ee007 Reviewed-on: https://skia-review.googlesource.com/114940 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'src/core/SkPathMeasure.cpp')
-rw-r--r--src/core/SkPathMeasure.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/SkPathMeasure.cpp b/src/core/SkPathMeasure.cpp
index cdcd164018..df47af5440 100644
--- a/src/core/SkPathMeasure.cpp
+++ b/src/core/SkPathMeasure.cpp
@@ -40,11 +40,13 @@ void SkPathMeasure_segTo(const SkPoint pts[], unsigned segType,
SkASSERT(startT <= stopT);
if (startT == stopT) {
- /* if the dash as a zero-length on segment, add a corresponding zero-length line.
- The stroke code will add end caps to zero length lines as appropriate */
- SkPoint lastPt;
- SkAssertResult(dst->getLastPt(&lastPt));
- dst->lineTo(lastPt);
+ if (!dst->isEmpty()) {
+ /* if the dash as a zero-length on segment, add a corresponding zero-length line.
+ The stroke code will add end caps to zero length lines as appropriate */
+ SkPoint lastPt;
+ SkAssertResult(dst->getLastPt(&lastPt));
+ dst->lineTo(lastPt);
+ }
return;
}