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