| Index: src/core/SkPath.cpp
|
| diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
|
| index 9df62850fd2eb5bc9cf442dc4675b7091cded8c1..29f68f4270af124b743849ebe5149a927ce5ba66 100644
|
| --- a/src/core/SkPath.cpp
|
| +++ b/src/core/SkPath.cpp
|
| @@ -2086,7 +2086,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) {
|
| @@ -2110,11 +2110,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;
|
| @@ -2128,16 +2128,16 @@ 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();
|
|
|
| GEN_ID_INC;
|
|
|
| SkDEBUGCODE(this->validate();)
|
| - return SkToU32(buffer.pos());
|
| + return buffer.isValid() ? buffer.pos() : 0;
|
| }
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|