diff options
author | Robert Phillips <robertphillips@google.com> | 2016-09-23 14:23:22 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-09-23 19:44:57 +0000 |
commit | 49da334086c4a2c0bc4cb99e97965600dcb72f73 (patch) | |
tree | e901a94815caa32d4e70f40f25621681cbb6f174 /include/core/SkRRect.h | |
parent | aa840647fc7f057715bce62489b96c4299385135 (diff) |
Add validation of RRects to SkValidatingReadBuffer
This comes from the Skia fuzzer where it is inverting the RRect's rect which causes trouble down the line.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2591
Change-Id: I5c34105a47369492d2df99d39a4e29116060ad37
Reviewed-on: https://skia-review.googlesource.com/2591
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include/core/SkRRect.h')
-rw-r--r-- | include/core/SkRRect.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/core/SkRRect.h b/include/core/SkRRect.h index 64db2f317b..3b691aab1b 100644 --- a/include/core/SkRRect.h +++ b/include/core/SkRRect.h @@ -16,7 +16,6 @@ class SkMatrix; // Path forward: // core work -// add validate method (all radii positive, all radii sums < rect size, etc.) // add contains(SkRect&) - for clip stack // add contains(SkRRect&) - for clip stack // add heart rect computation (max rect inside RR) @@ -90,7 +89,7 @@ public: * Returns the RR's sub type. */ Type getType() const { - SkDEBUGCODE(this->validate();) + SkASSERT(this->isValid()); return static_cast<Type>(fType); } @@ -124,7 +123,7 @@ public: memset(fRadii, 0, sizeof(fRadii)); fType = kEmpty_Type; - SkDEBUGCODE(this->validate();) + SkASSERT(this->isValid()); } /** @@ -142,7 +141,7 @@ public: memset(fRadii, 0, sizeof(fRadii)); fType = kRect_Type; - SkDEBUGCODE(this->validate();) + SkASSERT(this->isValid()); } static SkRRect MakeEmpty() { @@ -190,7 +189,7 @@ public: } fType = kOval_Type; - SkDEBUGCODE(this->validate();) + SkASSERT(this->isValid()); } /** @@ -288,7 +287,7 @@ public: */ bool contains(const SkRect& rect) const; - SkDEBUGCODE(void validate() const;) + bool isValid() const; enum { kSizeInMemory = 12 * sizeof(SkScalar) |