disallow -4 pointer
A user's homegrown unsigned integer overflow tool
complains if a nullptr is decremented.
The conicWeight pointer likes to predecrement
before walking, but this is unnecessary if
its value is nullptr.
R=reed@google.com
BUG=skia:5415
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2061833005
Review-Url: https://codereview.chromium.org/2061833005
diff --git a/src/core/SkPathRef.cpp b/src/core/SkPathRef.cpp
index 06a1519..e5efefc 100644
--- a/src/core/SkPathRef.cpp
+++ b/src/core/SkPathRef.cpp
@@ -619,7 +619,10 @@
fPts = path.points();
fVerbs = path.verbs();
fVerbStop = path.verbsMemBegin();
- fConicWeights = path.conicWeights() - 1; // begin one behind
+ fConicWeights = path.conicWeights();
+ if (fConicWeights) {
+ fConicWeights -= 1; // begin one behind
+ }
}
uint8_t SkPathRef::Iter::next(SkPoint pts[4]) {