diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-21 15:27:49 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-21 15:27:49 +0000 |
commit | 197fea2d1810874d76f5c1046b4713db5676e958 (patch) | |
tree | ce4140d92f9e63e22a67b6d32904fa4dc10d8d8c /src | |
parent | c4f3b23b83719ab371d87e0e3cf0f686107791f3 (diff) |
Potential fix for array bounds warning.
BUG=skia:2123
R=caryclark@google.com
Author: jvanverth@google.com
Review URL: https://codereview.chromium.org/164753003
git-svn-id: http://skia.googlecode.com/svn/trunk@13531 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/pathops/SkDCubicToQuads.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/pathops/SkDCubicToQuads.cpp b/src/pathops/SkDCubicToQuads.cpp index 3cf63f31d0..705320d208 100644 --- a/src/pathops/SkDCubicToQuads.cpp +++ b/src/pathops/SkDCubicToQuads.cpp @@ -136,17 +136,16 @@ void SkDCubic::toQuadraticTs(double precision, SkTArray<double, true>* ts) const memmove(inflectT, &inflectT[1], sizeof(inflectT[0]) * --inflections); } int start = 0; - do { - int next = start + 1; - if (next >= inflections) { - break; - } + int next = 1; + while (next < inflections) { if (!approximately_equal(inflectT[start], inflectT[next])) { ++start; + ++next; continue; } memmove(&inflectT[start], &inflectT[next], sizeof(inflectT[0]) * (--inflections - start)); - } while (true); + } + while (inflections && approximately_greater_than_one(inflectT[inflections - 1])) { --inflections; } |