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

Unified Diff: src/core/SkPathRef.cpp

Issue 732643002: Don't pass null to memcmp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: loosen test when strlen == 0 Created 6 years, 1 month 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 | tests/PathTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPathRef.cpp
diff --git a/src/core/SkPathRef.cpp b/src/core/SkPathRef.cpp
index dffb6a3646aefd27727ff357d63f855e4e4247b0..61763c1b068c92577b4bac815d5112d66e5ea2e2 100644
--- a/src/core/SkPathRef.cpp
+++ b/src/core/SkPathRef.cpp
@@ -193,12 +193,17 @@ bool SkPathRef::operator== (const SkPathRef& ref) const {
SkASSERT(!genIDMatch);
return false;
}
+ if (ref.fVerbCnt == 0 && ref.fPointCnt == 0) {
reed1 2014/11/14 17:09:41 is it enough to just check fVerbCnt (and if it is
mtklein 2014/11/14 17:13:20 Yes (until we add pointless verbs :P). Done.
+ return true;
+ }
+ SkASSERT(this->verbsMemBegin() && ref.verbsMemBegin());
if (0 != memcmp(this->verbsMemBegin(),
ref.verbsMemBegin(),
ref.fVerbCnt * sizeof(uint8_t))) {
SkASSERT(!genIDMatch);
return false;
}
+ SkASSERT(this->points() && ref.points());
if (0 != memcmp(this->points(),
ref.points(),
ref.fPointCnt * sizeof(SkPoint))) {
« no previous file with comments | « no previous file | tests/PathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698