Index: src/pdf/SkPDFStream.cpp |
diff --git a/src/pdf/SkPDFStream.cpp b/src/pdf/SkPDFStream.cpp |
index 60fce0d6f129b86d4f0f74779fe99afceabef449..c310998a57b3f9b6dae39b4d93d2187a8c0300ff 100644 |
--- a/src/pdf/SkPDFStream.cpp |
+++ b/src/pdf/SkPDFStream.cpp |
@@ -114,7 +114,9 @@ bool SkPDFStream::populate(SkPDFCatalog* catalog) { |
SkFlate::Deflate(fDataStream.get(), &compressedData)); |
SkAssertResult(fDataStream->rewind()); |
if (compressedData.getOffset() < this->dataSize()) { |
- this->setData(compressedData.detachAsStream()); |
+ SkAutoTUnref<SkStream> compressed( |
+ compressedData.detachAsStream()); |
+ this->setData(compressed.get()); |
insertName("Filter", "FlateDecode"); |
} |
fState = kCompressed_State; |