Index: src/effects/SkColorFilters.cpp |
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp |
index 8ef9edf2b21129304607f8cd55527e1eba977db9..d482a09d1f870323b21e5b34486f452558c011d2 100644 |
--- a/src/effects/SkColorFilters.cpp |
+++ b/src/effects/SkColorFilters.cpp |
@@ -101,8 +101,10 @@ protected: |
SkModeColorFilter(SkFlattenableReadBuffer& buffer) { |
fColor = buffer.readColor(); |
fMode = (SkXfermode::Mode)buffer.readUInt(); |
- this->updateCache(); |
- buffer.validate(SkIsValidMode(fMode)); |
+ if (buffer.isValid()) { |
+ this->updateCache(); |
+ buffer.validate(SkIsValidMode(fMode)); |
+ } |
} |
private: |