Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1211)

Unified Diff: src/effects/SkMergeImageFilter.cpp

Issue 37803002: Adding size parameter to read array functions (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fixed comments Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/effects/SkMergeImageFilter.cpp
diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp
index 4de1093612e1c7215412c3c2883a48839656ebf0..93e23356101c71430716d530113f224b2abf9d0a 100755
--- a/src/effects/SkMergeImageFilter.cpp
+++ b/src/effects/SkMergeImageFilter.cpp
@@ -161,10 +161,9 @@ SkMergeImageFilter::SkMergeImageFilter(SkFlattenableReadBuffer& buffer) : INHERI
if (hasModes) {
this->initAllocModes();
int nbInputs = countInputs();
- bool sizeMatches = buffer.getArrayCount() == nbInputs * sizeof(fModes[0]);
- buffer.validate(sizeMatches);
- SkASSERT(sizeMatches);
- buffer.readByteArray(fModes);
+ 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]));
}

Powered by Google App Engine
This is Rietveld 408576698