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

Unified Diff: src/pathops/SkDCubicToQuads.cpp

Issue 164753003: Potential fix for array bounds warning. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkDCubicToQuads.cpp
diff --git a/src/pathops/SkDCubicToQuads.cpp b/src/pathops/SkDCubicToQuads.cpp
index 3cf63f31d02986b2d16a59a7eced1602d4adbf4d..705320d2085c5c8edde0fc458e3ca62c44176385 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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698