summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_streamcontentparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/page/cpdf_streamcontentparser.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index 4c64e13b06..59de3c50cb 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -791,23 +791,24 @@ CPDF_ImageObject* CPDF_StreamContentParser::AddImage(
return nullptr;
auto pImageObj = pdfium::MakeUnique<CPDF_ImageObject>();
- pImageObj->SetOwnedImage(
- pdfium::MakeUnique<CPDF_Image>(m_pDocument, std::move(pStream)));
+ pImageObj->SetImage(
+ pdfium::MakeRetain<CPDF_Image>(m_pDocument, std::move(pStream)));
return AddImageObject(std::move(pImageObj));
}
CPDF_ImageObject* CPDF_StreamContentParser::AddImage(uint32_t streamObjNum) {
auto pImageObj = pdfium::MakeUnique<CPDF_ImageObject>();
- pImageObj->SetUnownedImage(m_pDocument->LoadImageFromPageData(streamObjNum));
+ pImageObj->SetImage(m_pDocument->LoadImageFromPageData(streamObjNum));
return AddImageObject(std::move(pImageObj));
}
-CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Image* pImage) {
+CPDF_ImageObject* CPDF_StreamContentParser::AddImage(
+ const CFX_RetainPtr<CPDF_Image>& pImage) {
if (!pImage)
return nullptr;
auto pImageObj = pdfium::MakeUnique<CPDF_ImageObject>();
- pImageObj->SetUnownedImage(
+ pImageObj->SetImage(
m_pDocument->GetPageData()->GetImage(pImage->GetStream()->GetObjNum()));
return AddImageObject(std::move(pImageObj));