Index: core/fpdfapi/fpdf_page/fpdf_page_parser.cpp |
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp |
index 483a6b1fd66e49bdd8f9dc7b3b2222c540de0688..991e4b1e9ff899ab864843aca5a8f949af7eec03 100644 |
--- a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp |
+++ b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp |
@@ -785,13 +785,13 @@ CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Stream* pStream, |
std::unique_ptr<CPDF_ImageObject> pImageObj(new CPDF_ImageObject); |
if (pImage) { |
- pImageObj->m_pImage = |
- m_pDocument->GetPageData()->GetImage(pImage->GetStream()); |
+ pImageObj->SetUnownedImage( |
+ m_pDocument->GetPageData()->GetImage(pImage->GetStream())); |
} else if (pStream->GetObjNum()) { |
- pImageObj->m_pImage = m_pDocument->LoadImageF(pStream); |
+ pImageObj->SetUnownedImage(m_pDocument->LoadImageF(pStream)); |
} else { |
- pImageObj->m_pImage = new CPDF_Image(m_pDocument); |
- pImageObj->m_pImage->LoadImageF(pStream, bInline); |
+ pImageObj->SetOwnedImage( |
+ WrapUnique(new CPDF_Image(m_pDocument, pStream, bInline))); |
} |
SetGraphicStates(pImageObj.get(), pImageObj->GetImage()->IsMask(), FALSE, |
FALSE); |