Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Unified Diff: src/pathops/SkOpSegment.cpp

Issue 2426173002: fix fuzzers (Closed)
Patch Set: fix dm Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pathops/SkOpCoincidence.cpp ('k') | src/pathops/SkPathOpsCommon.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpSegment.cpp
diff --git a/src/pathops/SkOpSegment.cpp b/src/pathops/SkOpSegment.cpp
index 6012d832bf349cb63d607bcf22a5ccc719a5fc10..439392fc4f6215854e84e0d80660e7903a4be449 100644
--- a/src/pathops/SkOpSegment.cpp
+++ b/src/pathops/SkOpSegment.cpp
@@ -169,18 +169,18 @@ bool SkOpSegment::addCurveTo(const SkOpSpanBase* start, const SkOpSpanBase* end,
path->deferredMove(start->ptT());
switch (verb) {
case SkPath::kLine_Verb:
- path->deferredLine(end->ptT());
+ FAIL_IF(!path->deferredLine(end->ptT()));
break;
case SkPath::kQuad_Verb:
- path->quadTo(curvePart.fCurve.fQuad.fPts[1].asSkPoint(), end->ptT());
+ path->quadTo(curvePart.fCurve.fQuad[1].asSkPoint(), end->ptT());
break;
case SkPath::kConic_Verb:
- path->conicTo(curvePart.fCurve.fConic.fPts[1].asSkPoint(), end->ptT(),
+ path->conicTo(curvePart.fCurve.fConic[1].asSkPoint(), end->ptT(),
curvePart.fCurve.fConic.fWeight);
break;
case SkPath::kCubic_Verb:
- path->cubicTo(curvePart.fCurve.fCubic.fPts[1].asSkPoint(),
- curvePart.fCurve.fCubic.fPts[2].asSkPoint(), end->ptT());
+ path->cubicTo(curvePart.fCurve.fCubic[1].asSkPoint(),
+ curvePart.fCurve.fCubic[2].asSkPoint(), end->ptT());
break;
default:
SkASSERT(0);
@@ -225,6 +225,7 @@ bool SkOpSegment::addExpanded(double newT, const SkOpSpanBase* test, bool* start
return true;
}
this->globalState()->resetAllocatedOpSpan();
+ FAIL_IF(!between(0, newT, 1));
SkOpPtT* newPtT = this->addT(newT);
*startOver |= this->globalState()->allocatedOpSpan();
if (!newPtT) {
« no previous file with comments | « src/pathops/SkOpCoincidence.cpp ('k') | src/pathops/SkPathOpsCommon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698