diff options
author | Cary Clark <caryclark@google.com> | 2017-07-05 10:38:22 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-06 12:35:14 +0000 |
commit | ae68a399cdf3d94aff28e497d5360bc288f2131d (patch) | |
tree | b6108249d8ba46de080e7f7b6816dab3e166e6bd | |
parent | 3223e276c994c08ecc72d6925851f17e2d9c4732 (diff) |
protect against fuzzer
Fuzzer data may generate path without a computable
length.
R=reed@google.com
Bug: 739190
Change-Id: I052540932937f24951ce66699080b8b959fb1a46
Reviewed-on: https://skia-review.googlesource.com/21500
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
-rw-r--r-- | src/core/SkPathMeasure.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/SkPathMeasure.cpp b/src/core/SkPathMeasure.cpp index 626deebd72..34b164827c 100644 --- a/src/core/SkPathMeasure.cpp +++ b/src/core/SkPathMeasure.cpp @@ -513,6 +513,9 @@ SkScalar SkPathMeasure::getLength() { if (fLength < 0) { this->buildSegments(); } + if (SkScalarIsNaN(fLength)) { + fLength = 0; + } SkASSERT(fLength >= 0); return fLength; } |