Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: src/pdf/SkPDFDevice.cpp

Issue 1381073005: SkPDF: ASAN fix: don't double ref new SkPDFBitmap objects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698