commit | ae68a399cdf3d94aff28e497d5360bc288f2131d | [log] [tgz] |
---|---|---|
author | Cary Clark <caryclark@google.com> | Wed Jul 05 10:38:22 2017 -0400 |
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | Thu Jul 06 12:35:14 2017 +0000 |
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>
diff --git a/src/core/SkPathMeasure.cpp b/src/core/SkPathMeasure.cpp index 626deeb..34b1648 100644 --- a/src/core/SkPathMeasure.cpp +++ b/src/core/SkPathMeasure.cpp
@@ -513,6 +513,9 @@ if (fLength < 0) { this->buildSegments(); } + if (SkScalarIsNaN(fLength)) { + fLength = 0; + } SkASSERT(fLength >= 0); return fLength; }