summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/fpdfapi/parser/cpdf_parser.cpp5
-rw-r--r--core/fpdfapi/parser/cpdf_syntax_parser.cpp4
-rw-r--r--core/fpdfapi/parser/cpdf_syntax_parser.h2
3 files changed, 8 insertions, 3 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp
index 657d0e0865..2ca820eb98 100644
--- a/core/fpdfapi/parser/cpdf_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_parser.cpp
@@ -126,7 +126,7 @@ CFX_RetainPtr<CPDF_CryptoHandler> CPDF_Parser::GetCryptoHandler() const {
}
CFX_RetainPtr<IFX_SeekableReadStream> CPDF_Parser::GetFileAccess() const {
- return m_pSyntax->m_pFileAccess;
+ return m_pSyntax->GetFileAccess();
}
void CPDF_Parser::ShrinkObjectMap(uint32_t objnum) {
@@ -615,7 +615,7 @@ bool CPDF_Parser::RebuildCrossRef() {
bool bOverFlow = false;
uint32_t size =
std::min((uint32_t)(m_pSyntax->m_FileLen - pos), kBufferSize);
- if (!m_pSyntax->m_pFileAccess->ReadBlock(buffer.data(), pos, size))
+ if (!m_pSyntax->GetFileAccess()->ReadBlock(buffer.data(), pos, size))
break;
for (uint32_t i = 0; i < size; i++) {
@@ -1506,7 +1506,6 @@ CPDF_Parser::Error CPDF_Parser::StartLinearizedParse(
return FORMAT_ERROR;
if (!IsLinearizedFile(pFileAccess, offset)) {
- m_pSyntax->m_pFileAccess = nullptr;
return StartParse(pFileAccess, std::move(pDocument));
}
m_bHasParsed = true;
diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp
index ce5a83579d..5fa3372d50 100644
--- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp
@@ -879,3 +879,7 @@ void CPDF_SyntaxParser::SetEncrypt(
const CFX_RetainPtr<CPDF_CryptoHandler>& pCryptoHandler) {
m_pCryptoHandler = pCryptoHandler;
}
+
+CFX_RetainPtr<IFX_SeekableReadStream> CPDF_SyntaxParser::GetFileAccess() const {
+ return m_pFileAccess;
+}
diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.h b/core/fpdfapi/parser/cpdf_syntax_parser.h
index 4c5e252978..d522b4ae7a 100644
--- a/core/fpdfapi/parser/cpdf_syntax_parser.h
+++ b/core/fpdfapi/parser/cpdf_syntax_parser.h
@@ -53,6 +53,8 @@ class CPDF_SyntaxParser {
bool GetCharAt(FX_FILESIZE pos, uint8_t& ch);
CFX_ByteString GetNextWord(bool* bIsNumber);
+ CFX_RetainPtr<IFX_SeekableReadStream> GetFileAccess() const;
+
private:
friend class CPDF_Parser;
friend class CPDF_DataAvail;