Index: src/effects/SkMergeImageFilter.cpp |
diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp |
index 33673b063927a249b89c77cefcac88e43d869a88..528fe823ebf7cdb6a3800f6fee31e7a0d9d1e476 100755 |
--- a/src/effects/SkMergeImageFilter.cpp |
+++ b/src/effects/SkMergeImageFilter.cpp |
@@ -165,7 +165,8 @@ SkMergeImageFilter::SkMergeImageFilter(SkFlattenableReadBuffer& buffer) |
int nbInputs = countInputs(); |
size_t size = nbInputs * sizeof(fModes[0]); |
SkASSERT(buffer.getArrayCount() == size); |
- if (buffer.readByteArray(fModes, size)) { |
+ if (buffer.validate(buffer.getArrayCount() == size) && |
+ buffer.readByteArray(fModes, size)) { |
for (int i = 0; i < nbInputs; ++i) { |
buffer.validate(SkIsValidMode((SkXfermode::Mode)fModes[i])); |
} |