Index: src/pdf/SkPDFDevice.cpp |
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp |
index 8d53b9918c39839513daec606e9a3a46a517b925..b6500c1ed426af246a0d22b18b700355fad69655 100644 |
--- a/src/pdf/SkPDFDevice.cpp |
+++ b/src/pdf/SkPDFDevice.cpp |
@@ -2282,7 +2282,7 @@ void SkPDFDevice::internalDrawImage(const SkMatrix& origMatrix, |
// TODO(halcanary): de-dupe this by caching filtered images. |
// (maybe in the resource cache?) |
} |
- SkAutoTUnref<SkPDFObject> pdfimage(fCanon->findPDFBitmap(image)); |
+ SkAutoTUnref<SkPDFObject> pdfimage(SkSafeRef(fCanon->findPDFBitmap(image))); |
if (!pdfimage) { |
pdfimage.reset(SkPDFCreateBitmapObject(image)); |
if (!pdfimage) { |
@@ -2290,6 +2290,6 @@ void SkPDFDevice::internalDrawImage(const SkMatrix& origMatrix, |
} |
fCanon->addPDFBitmap(image->uniqueID(), pdfimage); |
} |
- SkPDFUtils::DrawFormXObject(this->addXObjectResource(SkRef(pdfimage.get())), |
+ SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()), |
&content.entry()->fContent); |
} |