diff options
Diffstat (limited to 'core/fpdfapi/page/cpdf_streamcontentparser.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_streamcontentparser.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp index e7d23c0522..69b2b7e4e3 100644 --- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp +++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp @@ -825,12 +825,8 @@ CPDF_ImageObject* CPDF_StreamContentParser::AddImage( } CPDF_ImageObject* CPDF_StreamContentParser::AddImage(uint32_t streamObjNum) { - CPDF_Stream* pStream = ToStream(m_pDocument->GetIndirectObject(streamObjNum)); - if (!pStream) - return nullptr; - auto pImageObj = pdfium::MakeUnique<CPDF_ImageObject>(); - pImageObj->SetUnownedImage(m_pDocument->LoadImageF(pStream)); + pImageObj->SetUnownedImage(m_pDocument->LoadImageFromPageData(streamObjNum)); return AddImageObject(std::move(pImageObj)); } @@ -840,7 +836,7 @@ CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Image* pImage) { auto pImageObj = pdfium::MakeUnique<CPDF_ImageObject>(); pImageObj->SetUnownedImage( - m_pDocument->GetPageData()->GetImage(pImage->GetStream())); + m_pDocument->GetPageData()->GetImage(pImage->GetStream()->GetObjNum())); return AddImageObject(std::move(pImageObj)); } |