aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-03-16 14:59:12 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-21 15:06:28 +0000
commit9475aa0f90bd82fcc8e68deb56f70bd816719537 (patch)
tree9405d3029d2b7c680c81e6fc07d14e0d0906e564
parent486ee3d4c633b143e5aea8898b277be563cd2cd9 (diff)
handle extreme dashes
Make searching indices unsigned so intermediate middle doesn't overflow. Verified fix runs test in skia:7675 successfully. R=reed@google.com Bug: skia:7675 Change-Id: I76be1d3fee8875ae9eb2b18eb070ef66c8006c03 Reviewed-on: https://skia-review.googlesource.com/114798 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
-rw-r--r--src/core/SkPathMeasure.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/SkPathMeasure.cpp b/src/core/SkPathMeasure.cpp
index 7ce79f2780..4ddb5a5c53 100644
--- a/src/core/SkPathMeasure.cpp
+++ b/src/core/SkPathMeasure.cpp
@@ -528,11 +528,11 @@ int SkTKSearch(const T base[], int count, const K& key) {
SkASSERT(base != nullptr); // base may be nullptr if count is zero
- int lo = 0;
- int hi = count - 1;
+ unsigned lo = 0;
+ unsigned hi = count - 1;
while (lo < hi) {
- int mid = (hi + lo) >> 1;
+ unsigned mid = (hi + lo) >> 1;
if (base[mid].fDistance < key) {
lo = mid + 1;
} else {