fix fuzz
authorCary Clark <caryclark@google.com>
Mon, 12 Dec 2016 18:57:56 +0000 (13:57 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Mon, 12 Dec 2016 19:39:11 +0000 (19:39 +0000)
Don't walk off the end if the loop doesn't
contain the expected value.

R=kjlubick@google.com
BUG=skia:6047

Change-Id: I96815180dc7c92b45691037ae6c4b40beedc009a
Reviewed-on: https://skia-review.googlesource.com/5845
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>

src/pathops/SkOpCoincidence.cpp

index 1ade444..557da0a 100644 (file)
@@ -1004,6 +1004,7 @@ bool SkOpCoincidence::apply(DEBUG_COIN_DECLARE_ONLY_PARAMS()) {
                 if (oNext == oEnd) {
                     break;
                 }
+                FAIL_IF(!oNext->upCastable());
                 oStart = oNext->upCast();
             } while (true);
         }