Index: src/core/SkImageFilter.cpp |
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp |
index 3eb688e2c74d9848cfdd5a0028ecf159db7edfa7..11a1420dfaf2176973f4ce9cc09706ac63694c8c 100644 |
--- a/src/core/SkImageFilter.cpp |
+++ b/src/core/SkImageFilter.cpp |
@@ -44,7 +44,7 @@ bool SkImageFilter::Common::unflatten(SkReadBuffer& buffer, int expectedCount) { |
if (expectedCount < 0) { // means the caller doesn't care how many |
expectedCount = count; |
} |
- if (!buffer.validate(count == expectedCount)) { |
+ if (!buffer.validate((count == expectedCount) && (count >= 0))) { |
return false; |
} |