SkPDF: ASAN fix: don't double ref new SkPDFBitmap objects
TBR=robertphillips@google.com,tomhudson@google.com, Review URL: https://codereview.chromium.org/1381073005
This commit is contained in:
parent
f174e92873
commit
3d8c33cd83
@ -2282,7 +2282,7 @@ void SkPDFDevice::internalDrawImage(const SkMatrix& origMatrix,
|
|||||||
// TODO(halcanary): de-dupe this by caching filtered images.
|
// TODO(halcanary): de-dupe this by caching filtered images.
|
||||||
// (maybe in the resource cache?)
|
// (maybe in the resource cache?)
|
||||||
}
|
}
|
||||||
SkAutoTUnref<SkPDFObject> pdfimage(fCanon->findPDFBitmap(image));
|
SkAutoTUnref<SkPDFObject> pdfimage(SkSafeRef(fCanon->findPDFBitmap(image)));
|
||||||
if (!pdfimage) {
|
if (!pdfimage) {
|
||||||
pdfimage.reset(SkPDFCreateBitmapObject(image));
|
pdfimage.reset(SkPDFCreateBitmapObject(image));
|
||||||
if (!pdfimage) {
|
if (!pdfimage) {
|
||||||
@ -2290,6 +2290,6 @@ void SkPDFDevice::internalDrawImage(const SkMatrix& origMatrix,
|
|||||||
}
|
}
|
||||||
fCanon->addPDFBitmap(image->uniqueID(), pdfimage);
|
fCanon->addPDFBitmap(image->uniqueID(), pdfimage);
|
||||||
}
|
}
|
||||||
SkPDFUtils::DrawFormXObject(this->addXObjectResource(SkRef(pdfimage.get())),
|
SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()),
|
||||||
&content.entry()->fContent);
|
&content.entry()->fContent);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user