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

Unified Diff: src/effects/SkDashPathEffect.cpp

Issue 37803002: Adding size parameter to read array functions (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Added dox in SkFlattenableBuffers.h 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/SkDashPathEffect.cpp
diff --git a/src/effects/SkDashPathEffect.cpp b/src/effects/SkDashPathEffect.cpp
index 4aa46ab6bf10f277a81a4bc48e5a203030e89d4e..228b3061cebc344a633672a7c57d3f597f3b63af 100644
--- a/src/effects/SkDashPathEffect.cpp
+++ b/src/effects/SkDashPathEffect.cpp
@@ -554,6 +554,7 @@ SkDashPathEffect::SkDashPathEffect(SkFlattenableReadBuffer& buffer) : INHERITED(
fScaleToFit = buffer.readBool();
fCount = buffer.getArrayCount();
- fIntervals = (SkScalar*)sk_malloc_throw(sizeof(SkScalar) * fCount);
- buffer.readScalarArray(fIntervals);
+ uint32_t size = sizeof(SkScalar) * fCount;
+ fIntervals = (SkScalar*)sk_malloc_throw(size);
+ buffer.readScalarArray(fIntervals, size);
}

Powered by Google App Engine
This is Rietveld 408576698