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

Unified Diff: include/core/SkRRect.h

Issue 670183002: explicitly size fType in SkRRect, to ensure the are no uninitialized bytes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkRRect.h
diff --git a/include/core/SkRRect.h b/include/core/SkRRect.h
index d3f48cd48474f653d56fd45c468c8f6adaa03605..16670aab45b4067313cb99ab6e15b78e34202fb7 100644
--- a/include/core/SkRRect.h
+++ b/include/core/SkRRect.h
@@ -95,7 +95,7 @@ public:
this->computeType();
}
SkASSERT(kUnknown_Type != fType);
- return fType;
+ return static_cast<Type>(fType);
}
Type type() const { return this->getType(); }
@@ -304,7 +304,8 @@ private:
SkRect fRect;
// Radii order is UL, UR, LR, LL. Use Corner enum to index into fRadii[]
SkVector fRadii[4];
- mutable Type fType;
+ // use an explicitly sized type so we're sure the class is dense (no uninitialized bytes)
+ mutable int32_t fType;
// TODO: add padding so we can use memcpy for flattening and not copy
// uninitialized data
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698