Index: src/core/SkRRect.cpp |
diff --git a/src/core/SkRRect.cpp b/src/core/SkRRect.cpp |
index e3d11cb01efb294221315a9b2879f17332e0da7a..bcbf37ec5927925cb3109e9391d36876f6538985 100644 |
--- a/src/core/SkRRect.cpp |
+++ b/src/core/SkRRect.cpp |
@@ -259,7 +259,7 @@ void SkRRect::inset(SkScalar dx, SkScalar dy, SkRRect* dst) const { |
/////////////////////////////////////////////////////////////////////////////// |
-uint32_t SkRRect::writeToMemory(void* buffer) const { |
+size_t SkRRect::writeToMemory(void* buffer) const { |
SkASSERT(kSizeInMemory == sizeof(SkRect) + sizeof(fRadii)); |
memcpy(buffer, &fRect, sizeof(SkRect)); |
@@ -267,7 +267,11 @@ uint32_t SkRRect::writeToMemory(void* buffer) const { |
return kSizeInMemory; |
} |
-uint32_t SkRRect::readFromMemory(const void* buffer) { |
+size_t SkRRect::readFromMemory(const void* buffer, size_t length) { |
+ if (length < kSizeInMemory) { |
+ return 0; |
+ } |
+ |
SkScalar storage[12]; |
SkASSERT(sizeof(storage) == kSizeInMemory); |