summaryrefslogtreecommitdiff
path: root/xfa/fxfa
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa')
-rw-r--r--xfa/fxfa/cxfa_ffapp.cpp6
-rw-r--r--xfa/fxfa/cxfa_ffdoc.cpp8
2 files changed, 7 insertions, 7 deletions
diff --git a/xfa/fxfa/cxfa_ffapp.cpp b/xfa/fxfa/cxfa_ffapp.cpp
index 78de94e938..7b88626c91 100644
--- a/xfa/fxfa/cxfa_ffapp.cpp
+++ b/xfa/fxfa/cxfa_ffapp.cpp
@@ -35,13 +35,13 @@ class CXFA_FileRead : public IFX_SeekableReadStream {
bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override;
private:
- std::vector<std::unique_ptr<CPDF_StreamAcc>> m_Data;
+ std::vector<CFX_RetainPtr<CPDF_StreamAcc>> m_Data;
};
CXFA_FileRead::CXFA_FileRead(const std::vector<CPDF_Stream*>& streams) {
for (CPDF_Stream* pStream : streams) {
- m_Data.push_back(pdfium::MakeUnique<CPDF_StreamAcc>());
- m_Data.back()->LoadAllData(pStream);
+ m_Data.push_back(pdfium::MakeRetain<CPDF_StreamAcc>(pStream));
+ m_Data.back()->LoadAllData();
}
}
diff --git a/xfa/fxfa/cxfa_ffdoc.cpp b/xfa/fxfa/cxfa_ffdoc.cpp
index f48ae57fb2..993f5bc664 100644
--- a/xfa/fxfa/cxfa_ffdoc.cpp
+++ b/xfa/fxfa/cxfa_ffdoc.cpp
@@ -388,12 +388,12 @@ CFX_RetainPtr<CFX_DIBitmap> CXFA_FFDoc::GetPDFNamedImage(
if (!pStream)
return nullptr;
- CPDF_StreamAcc streamAcc;
- streamAcc.LoadAllData(pStream);
+ auto pAcc = pdfium::MakeRetain<CPDF_StreamAcc>(pStream);
+ pAcc->LoadAllData();
CFX_RetainPtr<IFX_SeekableReadStream> pImageFileRead =
- IFX_MemoryStream::Create((uint8_t*)streamAcc.GetData(),
- streamAcc.GetSize());
+ IFX_MemoryStream::Create(const_cast<uint8_t*>(pAcc->GetData()),
+ pAcc->GetSize());
CFX_RetainPtr<CFX_DIBitmap> pDibSource = XFA_LoadImageFromBuffer(
pImageFileRead, FXCODEC_IMAGE_UNKNOWN, iImageXDpi, iImageYDpi);