diff options
author | 2016-09-23 09:32:26 -0700 | |
---|---|---|
committer | 2016-09-23 09:32:27 -0700 | |
commit | cc09372730301be78b9d26c1198db1584622cdd9 (patch) | |
tree | 99be1f7a5c3cfefbb75b47f03ddf5d377a5c4fd8 /src/pathops/SkPathOpsCurve.cpp | |
parent | 94663795410c214db5232162076b8aea7e5f62d2 (diff) |
fix msan bug in pathops
Msan and Valgrind found an uninitialized memory mistake in
pathops. This also fixes similar bugs where not all parts
of the geometry were covered in the loop iteration.
R=borenet@google.com
NOTREECHECKS=true
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2366893003
Review-Url: https://codereview.chromium.org/2366893003
Diffstat (limited to 'src/pathops/SkPathOpsCurve.cpp')
-rw-r--r-- | src/pathops/SkPathOpsCurve.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pathops/SkPathOpsCurve.cpp b/src/pathops/SkPathOpsCurve.cpp index e96c4e89dd..503c140aa6 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))); } |