Index: src/effects/SkMergeImageFilter.cpp |
diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp |
index a5c32acaf77b973aa729998a7d8c47f5dbbb17ea..4de1093612e1c7215412c3c2883a48839656ebf0 100755 |
--- a/src/effects/SkMergeImageFilter.cpp |
+++ b/src/effects/SkMergeImageFilter.cpp |
@@ -161,7 +161,9 @@ SkMergeImageFilter::SkMergeImageFilter(SkFlattenableReadBuffer& buffer) : INHERI |
if (hasModes) { |
this->initAllocModes(); |
int nbInputs = countInputs(); |
- SkASSERT(buffer.getArrayCount() == nbInputs * sizeof(fModes[0])); |
+ bool sizeMatches = buffer.getArrayCount() == nbInputs * sizeof(fModes[0]); |
+ buffer.validate(sizeMatches); |
+ SkASSERT(sizeMatches); |
buffer.readByteArray(fModes); |
for (int i = 0; i < nbInputs; ++i) { |
buffer.validate(SkIsValidMode((SkXfermode::Mode)fModes[i])); |