diff options
author | Cary Clark <caryclark@skia.org> | 2018-03-21 16:17:10 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-02 15:15:25 +0000 |
commit | 9b8b0cee513bc242553f1639a28c3638f568842e (patch) | |
tree | 3c5efc4f728fefa532f2e8a5583c6ee57a9dd59b /include/core/SkRRect.h | |
parent | 01a1cf92603c048c81dec419177e4e5f76be50f6 (diff) |
fix SkRRect fuzzer assert
fuzzer bug triggers an assert in SkRRect::isValid because
on radius is zero and the other, while small, is not.
The radii are normally both set to zero if one is zero
in SkRRect::setRectRadii. However, subsequently scaleRadii
may set one to zero when normalizing the pair.
Move the clamping code out of setRectRadii so it can be
called from scaleRadii as well.
R=reed@google.com
Bug: skia:
Change-Id: Ib9a86da7212567b2f4b83d99a41cf9ba2c30e9b9
Reviewed-on: https://skia-review.googlesource.com/115701
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'include/core/SkRRect.h')
-rw-r--r-- | include/core/SkRRect.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/core/SkRRect.h b/include/core/SkRRect.h index a553191515..5e67f1fccb 100644 --- a/include/core/SkRRect.h +++ b/include/core/SkRRect.h @@ -327,7 +327,7 @@ private: void computeType(); bool checkCornerContainment(SkScalar x, SkScalar y) const; - void scaleRadii(); + void scaleRadii(const SkRect& rect); SkRect fRect = SkRect::MakeEmpty(); // Radii order is UL, UR, LR, LL. Use Corner enum to index into fRadii[] |