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

Unified Diff: src/pathops/SkPathOpsCurve.cpp

Issue 2366893003: fix msan bug in pathops (Closed)
Patch Set: Created 4 years, 3 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/SkOpEdgeBuilder.cpp ('k') | tests/PathOpsOpTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathOpsCurve.cpp
diff --git a/src/pathops/SkPathOpsCurve.cpp b/src/pathops/SkPathOpsCurve.cpp
index e96c4e89dda0d7feedfe0ce2eaa11a5ad6289445..503c140aa644bebdee4602f6daba4827210c9476 100644
--- a/src/pathops/SkPathOpsCurve.cpp
+++ b/src/pathops/SkPathOpsCurve.cpp
@@ -54,7 +54,7 @@ double SkDCurve::nearPoint(SkPath::Verb verb, const SkDPoint& xy, const SkDPoint
void SkDCurve::offset(SkPath::Verb verb, const SkDVector& off) {
int count = SkPathOpsVerbToPoints(verb);
- for (int index = 0; index < count; ++index) {
+ for (int index = 0; index <= count; ++index) {
fCubic.fPts[index] += off;
}
}
@@ -101,7 +101,7 @@ void SkDCurveSweep::setCurveHullSweep(SkPath::Verb verb) {
// OPTIMIZE: I do the following float check a lot -- probably need a
// central place for this val-is-small-compared-to-curve check
double maxVal = 0;
- for (int index = 0; index < SkPathOpsVerbToPoints(verb); ++index) {
+ for (int index = 0; index <= SkPathOpsVerbToPoints(verb); ++index) {
maxVal = SkTMax(maxVal, SkTMax(SkTAbs(fCurve[index].fX),
SkTAbs(fCurve[index].fY)));
}
« no previous file with comments | « src/pathops/SkOpEdgeBuilder.cpp ('k') | tests/PathOpsOpTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698