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

Unified Diff: src/core/SkMatrix.cpp

Issue 41253002: Checking structure sizes before reading them from memory to avoid overflowing the buffer's stream. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Removing SkMatrix's writeToMemory, readFromMemory 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/SkMatrix.cpp
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp
index 5bcb35b298874088004f5c39fba7133e85a0c323..e1736cd7a3d0fdee1f185e4a947f1f425124421e 100644
--- a/src/core/SkMatrix.cpp
+++ b/src/core/SkMatrix.cpp
@@ -1921,22 +1921,6 @@ const SkMatrix& SkMatrix::InvalidMatrix() {
///////////////////////////////////////////////////////////////////////////////
-uint32_t SkMatrix::writeToMemory(void* buffer) const {
- // TODO write less for simple matrices
- if (buffer) {
- memcpy(buffer, fMat, 9 * sizeof(SkScalar));
- }
- return 9 * sizeof(SkScalar);
-}
-
-uint32_t SkMatrix::readFromMemory(const void* buffer) {
- if (buffer) {
- memcpy(fMat, buffer, 9 * sizeof(SkScalar));
- this->setTypeMask(kUnknown_Mask);
- }
- return 9 * sizeof(SkScalar);
-}
-
#ifdef SK_DEVELOPER
void SkMatrix::dump() const {
SkString str;
« include/core/SkWriter32.h ('K') | « src/core/SkBuffer.cpp ('k') | src/core/SkPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698