| Index: src/core/SkPath.cpp
|
| diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
|
| index 60cfe0373c08628573cf5be16ff829f428e7cd0f..982d6ad936455d78c67d7c14aead2235167252c7 100644
|
| --- a/src/core/SkPath.cpp
|
| +++ b/src/core/SkPath.cpp
|
| @@ -2066,7 +2066,7 @@ SkPath::Verb SkPath::RawIter::next(SkPoint pts[4]) {
|
| Format in compressed buffer: [ptCount, verbCount, pts[], verbs[]]
|
| */
|
|
|
| -uint32_t SkPath::writeToMemory(void* storage) const {
|
| +size_t SkPath::writeToMemory(void* storage) const {
|
| SkDEBUGCODE(this->validate();)
|
|
|
| if (NULL == storage) {
|
| @@ -2090,11 +2090,11 @@ uint32_t SkPath::writeToMemory(void* storage) const {
|
| fPathRef->writeToBuffer(&buffer);
|
|
|
| buffer.padToAlign4();
|
| - return SkToU32(buffer.pos());
|
| + return buffer.pos();
|
| }
|
|
|
| -uint32_t SkPath::readFromMemory(const void* storage) {
|
| - SkRBuffer buffer(storage);
|
| +size_t SkPath::readFromMemory(const void* storage, size_t length) {
|
| + SkRBufferWithSizeCheck buffer(storage, length);
|
|
|
| uint32_t packed = buffer.readS32();
|
| fIsOval = (packed >> kIsOval_SerializationShift) & 1;
|
| @@ -2108,14 +2108,14 @@ uint32_t SkPath::readFromMemory(const void* storage) {
|
|
|
| fPathRef.reset(SkPathRef::CreateFromBuffer(&buffer
|
| #ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V14_AND_ALL_OTHER_INSTANCES_TOO
|
| - , newFormat, packed)
|
| + , newFormat, packed
|
| #endif
|
| - );
|
| + ));
|
|
|
| buffer.skipToAlign4();
|
|
|
| SkDEBUGCODE(this->validate();)
|
| - return SkToU32(buffer.pos());
|
| + return buffer.isValid() ? buffer.pos() : 0;
|
| }
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|