Index: src/core/SkPathEffect.cpp |
diff --git a/src/core/SkPathEffect.cpp b/src/core/SkPathEffect.cpp |
index 2403ffcb30c5f99511ebed3c6d7cf9b589231027..293bb53b2c416a55ce931b6c727e7d0e686a7047 100644 |
--- a/src/core/SkPathEffect.cpp |
+++ b/src/core/SkPathEffect.cpp |
@@ -67,7 +67,11 @@ void SkPairPathEffect::toString(SkString* str) const { |
SkFlattenable* SkComposePathEffect::CreateProc(SkReadBuffer& buffer) { |
SkAutoTUnref<SkPathEffect> pe0(buffer.readPathEffect()); |
SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect()); |
- return SkComposePathEffect::Create(pe0, pe1); |
+ if (pe0 && pe1) { |
+ return SkComposePathEffect::Create(pe0, pe1); |
+ } else { |
+ return nullptr; |
+ } |
} |
bool SkComposePathEffect::filterPath(SkPath* dst, const SkPath& src, |
@@ -100,7 +104,11 @@ void SkComposePathEffect::toString(SkString* str) const { |
SkFlattenable* SkSumPathEffect::CreateProc(SkReadBuffer& buffer) { |
SkAutoTUnref<SkPathEffect> pe0(buffer.readPathEffect()); |
SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect()); |
- return SkSumPathEffect::Create(pe0, pe1); |
+ if (pe0 && pe1) { |
+ return SkSumPathEffect::Create(pe0, pe1); |
+ } else { |
+ return nullptr; |
+ } |
} |
bool SkSumPathEffect::filterPath(SkPath* dst, const SkPath& src, |