check for zero conic weights in interp
authorcaryclark <caryclark@google.com>
Thu, 18 Feb 2016 17:00:01 +0000 (09:00 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 18 Feb 2016 17:00:01 +0000 (09:00 -0800)
this will fix the current (and uncover the next)
ASAN failure

TBR=tomhudson@google.com
BUG=skia:4549
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1711813002

Review URL: https://codereview.chromium.org/1711813002

src/core/SkPath.cpp

index 10e80a4..06bbeef 100644 (file)
@@ -205,7 +205,8 @@ bool SkPath::isInterpolatable(const SkPath& compare) const {
                count)) {
         return false;
     }
-    return !SkToBool(memcmp(fPathRef->conicWeights(), compare.fPathRef->conicWeights(),
+    return !fPathRef->countWeights() ||
+            !SkToBool(memcmp(fPathRef->conicWeights(), compare.fPathRef->conicWeights(),
             fPathRef->countWeights() * sizeof(*fPathRef->conicWeights())));
 }