diff options
author | 2017-03-21 10:30:50 -0400 | |
---|---|---|
committer | 2017-03-21 15:18:11 +0000 | |
commit | 28da2837040cd116dd2d854dd3268723ca219f11 (patch) | |
tree | 9964e5452b2af80dfe6bf6275a6283395f798d5f /src/pathops/SkOpContour.h | |
parent | 90960eb1face12f7855c98db0e4af11c03377829 (diff) |
fix fuzz
corrupted intersection point lists
can loop forever. Add a safety
hatch to abort after a large number
of iterations.
TBR=kjlubick@google.com
BUG=700679
Change-Id: Ifd4b180b47ba3bbde38ade0bb13b16b8d645c1cb
Reviewed-on: https://skia-review.googlesource.com/9967
Reviewed-by: Cary Clark <caryclark@skia.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'src/pathops/SkOpContour.h')
-rw-r--r-- | src/pathops/SkOpContour.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pathops/SkOpContour.h b/src/pathops/SkOpContour.h index 6e705bcdd7..c283226590 100644 --- a/src/pathops/SkOpContour.h +++ b/src/pathops/SkOpContour.h @@ -243,12 +243,15 @@ public: return true; } - void moveNearby() { + bool moveNearby() { SkASSERT(fCount > 0); SkOpSegment* segment = &fHead; do { - segment->moveNearby(); + if (!segment->moveNearby()) { + return false; + } } while ((segment = segment->next())); + return true; } SkOpContour* next() { |