aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-24 20:25:32 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-24 20:25:32 +0000
commit50108cdbfea57e983667cd1fecd97a8a9df26b20 (patch)
treec2d1821be2ff104319486beb3bb159cec079a8d5 /src
parentf4ff39ca4854d64fce9189745af615bb9bc37faa (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/core/SkPictureFlat.cpp4
1 files changed, 2 insertions, 2 deletions
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;
}