From 50108cdbfea57e983667cd1fecd97a8a9df26b20 Mon Sep 17 00:00:00 2001 From: "senorblanco@chromium.org" Date: Tue, 24 May 2011 20:25:32 +0000 Subject: Grab-bag of memory fixes. SkFlatMatrix::Flatten had the same issue as Sk2DPathEffect: it was encoding a partially-unintialized matrix type mask. The others are simply uninitialized vars in the sample code. Review URL: http://codereview.appspot.com/4539072/ git-svn-id: http://skia.googlecode.com/svn/trunk@1414 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/core/SkPictureFlat.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/SkPictureFlat.cpp b/src/core/SkPictureFlat.cpp index 5c5ea0b7c9..105df3ce83 100644 --- a/src/core/SkPictureFlat.cpp +++ b/src/core/SkPictureFlat.cpp @@ -28,9 +28,9 @@ SkFlatBitmap* SkFlatBitmap::Flatten(SkChunkAlloc* heap, const SkBitmap& bitmap, } SkFlatMatrix* SkFlatMatrix::Flatten(SkChunkAlloc* heap, const SkMatrix& matrix, int index) { - int32_t size = sizeof(SkMatrix); + size_t size = matrix.flatten(NULL); SkFlatMatrix* result = (SkFlatMatrix*) INHERITED::Alloc(heap, size, index); - memcpy(&result->fMatrixData, &matrix, sizeof(SkMatrix)); + matrix.flatten(&result->fMatrixData); return result; } -- cgit v1.2.3