Index: src/core/SkReadBuffer.cpp |
diff --git a/src/core/SkReadBuffer.cpp b/src/core/SkReadBuffer.cpp |
index 5356d4a6b1f47ab27db1ba9d7eb9743403e77da4..43eaf2026134c7832aa0213c50424ca5d33ff008 100644 |
--- a/src/core/SkReadBuffer.cpp |
+++ b/src/core/SkReadBuffer.cpp |
@@ -297,14 +297,13 @@ sk_sp<SkImage> SkReadBuffer::readImage() { |
return image ? image : MakeEmptyImage(width, height); |
} |
-SkTypeface* SkReadBuffer::readTypeface() { |
- |
+sk_sp<SkTypeface> SkReadBuffer::readTypeface() { |
uint32_t index = fReader.readU32(); |
if (0 == index || index > (unsigned)fTFCount) { |
return nullptr; |
} else { |
SkASSERT(fTFArray); |
- return fTFArray[index - 1]; |
+ return sk_ref_sp(fTFArray[index - 1]); |
} |
} |