aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2016-06-29 10:46:08 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-29 10:46:08 -0700
commitaa7ceb62b51bfe1057c83b3475797ec7c82bc964 (patch)
tree7ae4ede3ac4d6817b4d9701c555d4163ca34fe9d /src
parentfb40923afdb31f86c5f53f93a5c3885605292ac6 (diff)
fix another pathops fuzz bug
Tunnel out the error case when the numerics create uncalculable angles. R=mmoroz@chromium.org TBR=reed@google.com BUG=624351 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2103863005 Review-Url: https://codereview.chromium.org/2103863005
Diffstat (limited to 'src')
-rw-r--r--src/pathops/SkPathOpsCommon.cpp3
-rw-r--r--src/pathops/SkPathOpsOp.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/pathops/SkPathOpsCommon.cpp b/src/pathops/SkPathOpsCommon.cpp
index ec8e78d0cb..24ef6f1129 100644
--- a/src/pathops/SkPathOpsCommon.cpp
+++ b/src/pathops/SkPathOpsCommon.cpp
@@ -27,6 +27,9 @@ const SkOpAngle* AngleWinding(SkOpSpanBase* start, SkOpSpanBase* end, int* windi
int winding = SK_MinS32;
do {
angle = angle->next();
+ if (!angle) {
+ return nullptr;
+ }
unorderable |= angle->unorderable();
if ((computeWinding = unorderable || (angle == firstAngle && loop))) {
break; // if we get here, there's no winding, loop is unorderable
diff --git a/src/pathops/SkPathOpsOp.cpp b/src/pathops/SkPathOpsOp.cpp
index 25795047c8..1970eea124 100644
--- a/src/pathops/SkPathOpsOp.cpp
+++ b/src/pathops/SkPathOpsOp.cpp
@@ -36,6 +36,9 @@ static SkOpSegment* findChaseOp(SkTDArray<SkOpSpanBase*>& chase, SkOpSpanBase**
int winding;
bool sortable;
const SkOpAngle* angle = AngleWinding(*startPtr, *endPtr, &winding, &sortable);
+ if (!angle) {
+ return nullptr;
+ }
if (winding == SK_MinS32) {
continue;
}