diff options
author | Mike Klein <mtklein@chromium.org> | 2017-09-08 15:00:25 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-08 19:56:38 +0000 |
commit | 1170a553be35920fe45d6a454a27d21167060977 (patch) | |
tree | d293631bb26ce038885723d75238c98658a62439 /src/core/SkPathRef.cpp | |
parent | 900cd05037739eac6fd7bb8611ac489bb5ad305e (diff) |
Don't allow iteration through non-finite points.
Added a unit test too.
BUG=chromium:756563
Change-Id: Ic77a89b4a98d1a553877af9807a3d3bdcd077bb9
Reviewed-on: https://skia-review.googlesource.com/44420
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkPathRef.cpp')
-rw-r--r-- | src/core/SkPathRef.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/SkPathRef.cpp b/src/core/SkPathRef.cpp index 5894b0522b..46f26606ee 100644 --- a/src/core/SkPathRef.cpp +++ b/src/core/SkPathRef.cpp @@ -298,7 +298,7 @@ SkPathRef* SkPathRef::CreateFromBuffer(SkRBuffer* buffer) { return nullptr; } } - + ref->fBoundsIsDirty = false; // resetToSize clears fSegmentMask and fIsOval @@ -691,6 +691,11 @@ void SkPathRef::Iter::setPathRef(const SkPathRef& path) { if (fConicWeights) { fConicWeights -= 1; // begin one behind } + + // Don't allow iteration through non-finite points. + if (!path.isFinite()) { + fVerbStop = fVerbs; + } } uint8_t SkPathRef::Iter::next(SkPoint pts[4]) { |