diff options
Diffstat (limited to 'src/core/SkRRect.cpp')
-rw-r--r-- | src/core/SkRRect.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/SkRRect.cpp b/src/core/SkRRect.cpp index e3d11cb01e..bcbf37ec59 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); |