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

Unified Diff: src/core/SkColorTable.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/core/SkColorTable.cpp
diff --git a/src/core/SkColorTable.cpp b/src/core/SkColorTable.cpp
index 242ea6ba64a5c37e1440da31c7fff6a51a3ca42c..38a46c51a43902d16efec5493c9dcb0171220c71 100644
--- a/src/core/SkColorTable.cpp
+++ b/src/core/SkColorTable.cpp
@@ -93,10 +93,10 @@ SkColorTable::SkColorTable(SkFlattenableReadBuffer& buffer) {
fAlphaType = SkToU8(buffer.readUInt());
fCount = buffer.getArrayCount();
fColors = (SkPMColor*)sk_malloc_throw(fCount * sizeof(SkPMColor));
- SkDEBUGCODE(const uint32_t countRead =) buffer.readColorArray(fColors);
+ SkDEBUGCODE(bool success =) buffer.readColorArray(fColors, fCount);
#ifdef SK_DEBUG
SkASSERT((unsigned)fCount <= 256);
- SkASSERT(countRead == fCount);
+ SkASSERT(success);
#endif
}

Powered by Google App Engine
This is Rietveld 408576698