aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/SkImageFilter.cpp3
-rw-r--r--src/core/SkImageFilterCache.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 3854b83e59..b2220a7651 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -197,6 +197,9 @@ void SkImageFilter::flatten(SkWriteBuffer& buffer) const {
sk_sp<SkSpecialImage> SkImageFilter::filterImage(SkSpecialImage* src, const Context& context,
SkIPoint* offset) const {
SkASSERT(src && offset);
+ if (!context.isValid()) {
+ return nullptr;
+ }
uint32_t srcGenID = fUsesSrcInput ? src->uniqueID() : 0;
const SkIRect srcSubset = fUsesSrcInput ? src->subset() : SkIRect::MakeWH(0, 0);
diff --git a/src/core/SkImageFilterCache.h b/src/core/SkImageFilterCache.h
index 115b41370e..2211a7aaca 100644
--- a/src/core/SkImageFilterCache.h
+++ b/src/core/SkImageFilterCache.h
@@ -28,6 +28,7 @@ struct SkImageFilterCacheKey {
sizeof(SkIRect) + sizeof(uint32_t) + 4 * sizeof(int32_t),
"image_filter_key_tight_packing");
fMatrix.getType(); // force initialization of type, so hashes match
+ SkASSERT(fMatrix.isFinite()); // otherwise we can't rely on == self when comparing keys
}
uint32_t fUniqueID;