summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_contentparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/page/cpdf_contentparser.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_contentparser.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/core/fpdfapi/page/cpdf_contentparser.cpp b/core/fpdfapi/page/cpdf_contentparser.cpp
index 46e2c52c75..96bc7a2221 100644
--- a/core/fpdfapi/page/cpdf_contentparser.cpp
+++ b/core/fpdfapi/page/cpdf_contentparser.cpp
@@ -55,8 +55,8 @@ void CPDF_ContentParser::Start(CPDF_Page* pPage) {
}
if (CPDF_Stream* pStream = pContent->AsStream()) {
m_nStreams = 0;
- m_pSingleStream = pdfium::MakeUnique<CPDF_StreamAcc>();
- m_pSingleStream->LoadAllData(pStream, false);
+ m_pSingleStream = pdfium::MakeRetain<CPDF_StreamAcc>(pStream);
+ m_pSingleStream->LoadAllData(false);
} else if (CPDF_Array* pArray = pContent->AsArray()) {
m_nStreams = pArray->GetCount();
if (m_nStreams)
@@ -114,8 +114,8 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm,
pState->SetSoftMask(nullptr);
}
m_nStreams = 0;
- m_pSingleStream = pdfium::MakeUnique<CPDF_StreamAcc>();
- m_pSingleStream->LoadAllData(pForm->m_pFormStream, false);
+ m_pSingleStream = pdfium::MakeRetain<CPDF_StreamAcc>(pForm->m_pFormStream);
+ m_pSingleStream->LoadAllData(false);
m_pData = (uint8_t*)m_pSingleStream->GetData();
m_Size = m_pSingleStream->GetSize();
m_Status = ToBeContinued;
@@ -156,10 +156,11 @@ void CPDF_ContentParser::Continue(IFX_Pause* pPause) {
} else {
CPDF_Array* pContent =
m_pObjectHolder->m_pFormDict->GetArrayFor("Contents");
- m_StreamArray[m_CurrentOffset] = pdfium::MakeUnique<CPDF_StreamAcc>();
CPDF_Stream* pStreamObj = ToStream(
pContent ? pContent->GetDirectObjectAt(m_CurrentOffset) : nullptr);
- m_StreamArray[m_CurrentOffset]->LoadAllData(pStreamObj, false);
+ m_StreamArray[m_CurrentOffset] =
+ pdfium::MakeRetain<CPDF_StreamAcc>(pStreamObj);
+ m_StreamArray[m_CurrentOffset]->LoadAllData(false);
m_CurrentOffset++;
}
}