aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkPathEffect.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-02-22 12:50:25 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-22 12:50:26 -0800
commitca726abe1e4a2522b24e5143c5faf0e594a4802a (patch)
tree82aeae3da478bb96e94d8c152ec9646baa799ba9 /include/core/SkPathEffect.h
parentd49a86ade0bab1fc3048d6ba5d8536abf25ed77c (diff)
fix misc asserts and checks found by fuzzer
Diffstat (limited to 'include/core/SkPathEffect.h')
-rw-r--r--include/core/SkPathEffect.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/core/SkPathEffect.h b/include/core/SkPathEffect.h
index bd68c8fa72..a77b9467e4 100644
--- a/include/core/SkPathEffect.h
+++ b/include/core/SkPathEffect.h
@@ -183,7 +183,13 @@ public:
The reference counts for outer and inner are both incremented in the constructor,
and decremented in the destructor.
*/
- static SkComposePathEffect* Create(SkPathEffect* outer, SkPathEffect* inner) {
+ static SkPathEffect* Create(SkPathEffect* outer, SkPathEffect* inner) {
+ if (!outer) {
+ return SkSafeRef(inner);
+ }
+ if (!inner) {
+ return SkSafeRef(outer);
+ }
return new SkComposePathEffect(outer, inner);
}
@@ -220,7 +226,13 @@ public:
The reference counts for first and second are both incremented in the constructor,
and decremented in the destructor.
*/
- static SkSumPathEffect* Create(SkPathEffect* first, SkPathEffect* second) {
+ static SkPathEffect* Create(SkPathEffect* first, SkPathEffect* second) {
+ if (!first) {
+ return SkSafeRef(second);
+ }
+ if (!second) {
+ return SkSafeRef(first);
+ }
return new SkSumPathEffect(first, second);
}