summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/render')
-rw-r--r--core/fpdfapi/render/cpdf_dibsource.cpp20
-rw-r--r--core/fpdfapi/render/cpdf_dibsource.h4
2 files changed, 12 insertions, 12 deletions
diff --git a/core/fpdfapi/render/cpdf_dibsource.cpp b/core/fpdfapi/render/cpdf_dibsource.cpp
index 12bfadb19d..e60d0329d0 100644
--- a/core/fpdfapi/render/cpdf_dibsource.cpp
+++ b/core/fpdfapi/render/cpdf_dibsource.cpp
@@ -165,8 +165,8 @@ bool CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream) {
if (!src_size.IsValid())
return false;
- m_pStreamAcc = pdfium::MakeUnique<CPDF_StreamAcc>();
- m_pStreamAcc->LoadAllData(pStream, false, src_size.ValueOrDie(), true);
+ m_pStreamAcc = pdfium::MakeRetain<CPDF_StreamAcc>(pStream);
+ m_pStreamAcc->LoadAllData(false, src_size.ValueOrDie(), true);
if (m_pStreamAcc->GetSize() == 0 || !m_pStreamAcc->GetData())
return false;
@@ -278,8 +278,8 @@ int CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc,
if (!src_size.IsValid()) {
return 0;
}
- m_pStreamAcc = pdfium::MakeUnique<CPDF_StreamAcc>();
- m_pStreamAcc->LoadAllData(pStream, false, src_size.ValueOrDie(), true);
+ m_pStreamAcc = pdfium::MakeRetain<CPDF_StreamAcc>(pStream);
+ m_pStreamAcc->LoadAllData(false, src_size.ValueOrDie(), true);
if (m_pStreamAcc->GetSize() == 0 || !m_pStreamAcc->GetData()) {
return 0;
}
@@ -325,17 +325,17 @@ int CPDF_DIBSource::ContinueLoadDIBSource(IFX_Pause* pPause) {
CPDF_Stream* pGlobals =
m_pStreamAcc->GetImageParam()->GetStreamFor("JBIG2Globals");
if (pGlobals) {
- m_pGlobalStream = pdfium::MakeUnique<CPDF_StreamAcc>();
- m_pGlobalStream->LoadAllData(pGlobals, false);
+ m_pGlobalStream = pdfium::MakeRetain<CPDF_StreamAcc>(pGlobals);
+ m_pGlobalStream->LoadAllData(false);
}
}
ret = pJbig2Module->StartDecode(
m_pJbig2Context.get(), m_pDocument->CodecContext(), m_Width, m_Height,
- m_pStreamAcc.get(), m_pGlobalStream.get(),
- m_pCachedBitmap->GetBuffer(), m_pCachedBitmap->GetPitch(), pPause);
+ m_pStreamAcc, m_pGlobalStream, m_pCachedBitmap->GetBuffer(),
+ m_pCachedBitmap->GetPitch(), pPause);
if (ret < 0) {
m_pCachedBitmap.Reset();
- m_pGlobalStream.reset();
+ m_pGlobalStream.Reset();
m_pJbig2Context.reset();
return 0;
}
@@ -358,7 +358,7 @@ int CPDF_DIBSource::ContinueLoadDIBSource(IFX_Pause* pPause) {
ret = pJbig2Module->ContinueDecode(m_pJbig2Context.get(), pPause);
if (ret < 0) {
m_pCachedBitmap.Reset();
- m_pGlobalStream.reset();
+ m_pGlobalStream.Reset();
m_pJbig2Context.reset();
return 0;
}
diff --git a/core/fpdfapi/render/cpdf_dibsource.h b/core/fpdfapi/render/cpdf_dibsource.h
index c77aac1776..f484f57d75 100644
--- a/core/fpdfapi/render/cpdf_dibsource.h
+++ b/core/fpdfapi/render/cpdf_dibsource.h
@@ -118,7 +118,7 @@ class CPDF_DIBSource : public CFX_DIBSource {
CPDF_Document* m_pDocument;
const CPDF_Stream* m_pStream;
- std::unique_ptr<CPDF_StreamAcc> m_pStreamAcc;
+ CFX_RetainPtr<CPDF_StreamAcc> m_pStreamAcc;
const CPDF_Dictionary* m_pDict;
CPDF_ColorSpace* m_pColorSpace;
uint32_t m_Family;
@@ -139,8 +139,8 @@ class CPDF_DIBSource : public CFX_DIBSource {
uint8_t* m_pMaskedLine;
CFX_RetainPtr<CFX_DIBitmap> m_pCachedBitmap;
CFX_RetainPtr<CPDF_DIBSource> m_pMask;
+ CFX_RetainPtr<CPDF_StreamAcc> m_pGlobalStream;
std::unique_ptr<CCodec_ScanlineDecoder> m_pDecoder;
- std::unique_ptr<CPDF_StreamAcc> m_pGlobalStream;
std::unique_ptr<CCodec_Jbig2Context> m_pJbig2Context;
CPDF_Stream* m_pMaskStream;
int m_Status;