diff options
author | halcanary <halcanary@google.com> | 2015-10-01 11:06:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-01 11:06:22 -0700 |
commit | 3d8c33cd835054affab43ac8c96f349147d2e776 (patch) | |
tree | 4f8df5c8653ebf5c226543cf5d859cdf842de95c /src | |
parent | f174e928732d69a0884d07168862265a97da10d8 (diff) |
SkPDF: ASAN fix: don't double ref new SkPDFBitmap objects
TBR=robertphillips@google.com,tomhudson@google.com,
Review URL: https://codereview.chromium.org/1381073005
Diffstat (limited to 'src')
-rw-r--r-- | src/pdf/SkPDFDevice.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp index 8d53b9918c..b6500c1ed4 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); } |