diff options
Diffstat (limited to 'core/fpdfapi/parser/cpdf_stream_acc.cpp')
-rw-r--r-- | core/fpdfapi/parser/cpdf_stream_acc.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/core/fpdfapi/parser/cpdf_stream_acc.cpp b/core/fpdfapi/parser/cpdf_stream_acc.cpp index 91d458f9a7..b539117bd3 100644 --- a/core/fpdfapi/parser/cpdf_stream_acc.cpp +++ b/core/fpdfapi/parser/cpdf_stream_acc.cpp @@ -16,6 +16,12 @@ CPDF_StreamAcc::CPDF_StreamAcc(const CPDF_Stream* pStream) m_pStream(pStream), m_pSrcData(nullptr) {} +CPDF_StreamAcc::~CPDF_StreamAcc() { + if (m_bNewBuf) + FX_Free(m_pData); + FX_Free(m_pSrcData); +} + void CPDF_StreamAcc::LoadAllData(bool bRawAccess, uint32_t estimated_size, bool bImageAcc) { @@ -54,10 +60,8 @@ void CPDF_StreamAcc::LoadAllData(bool bRawAccess, m_bNewBuf = m_pData != m_pStream->GetRawData(); } -CPDF_StreamAcc::~CPDF_StreamAcc() { - if (m_bNewBuf) - FX_Free(m_pData); - FX_Free(m_pSrcData); +CPDF_Dictionary* CPDF_StreamAcc::GetDict() const { + return m_pStream ? m_pStream->GetDict() : nullptr; } const uint8_t* CPDF_StreamAcc::GetData() const { |