From 3c6b72f79fce629c903ce31f07092df23f870bb6 Mon Sep 17 00:00:00 2001 From: Artem Strygin Date: Thu, 31 Aug 2017 15:01:28 +0300 Subject: Disable objects decryption if it is useless. Change-Id: I6a588b4af4cfede922bc3756be749e9e30e3e8e5 Reviewed-on: https://pdfium-review.googlesource.com/12370 Reviewed-by: dsinclair Commit-Queue: Art Snake --- core/fpdfapi/parser/cfdf_document.cpp | 4 ++-- core/fpdfapi/parser/cpdf_data_avail.cpp | 4 ++-- core/fpdfapi/parser/cpdf_parser.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/fpdfapi/parser/cfdf_document.cpp b/core/fpdfapi/parser/cfdf_document.cpp index b00806967b..41827db0d9 100644 --- a/core/fpdfapi/parser/cfdf_document.cpp +++ b/core/fpdfapi/parser/cfdf_document.cpp @@ -67,7 +67,7 @@ void CFDF_Document::ParseStream( break; std::unique_ptr pObj = - parser.GetObject(this, objnum, 0, true); + parser.GetObject(this, objnum, 0, false); if (!pObj) break; @@ -80,7 +80,7 @@ void CFDF_Document::ParseStream( break; std::unique_ptr pMainDict = - ToDictionary(parser.GetObject(this, 0, 0, true)); + ToDictionary(parser.GetObject(this, 0, 0, false)); if (pMainDict) m_pRootDict = pMainDict->GetDictFor("Root"); diff --git a/core/fpdfapi/parser/cpdf_data_avail.cpp b/core/fpdfapi/parser/cpdf_data_avail.cpp index b7ea238507..b10029d4ce 100644 --- a/core/fpdfapi/parser/cpdf_data_avail.cpp +++ b/core/fpdfapi/parser/cpdf_data_avail.cpp @@ -680,7 +680,7 @@ std::unique_ptr CPDF_DataAvail::ParseIndirectObjectAt( } std::unique_ptr pObj = - m_syntaxParser.GetObject(pObjList, parser_objnum, gennum, true); + m_syntaxParser.GetObject(pObjList, parser_objnum, gennum, false); m_syntaxParser.SetPos(SavedPos); return pObj; } @@ -926,7 +926,7 @@ bool CPDF_DataAvail::CheckTrailer() { const CPDF_ReadValidator::Session read_session(GetValidator().Get()); m_syntaxParser.SetPos(m_dwTrailerOffset); const std::unique_ptr pTrailer = - m_syntaxParser.GetObject(nullptr, 0, 0, true); + m_syntaxParser.GetObject(nullptr, 0, 0, false); if (!pTrailer) { if (!GetValidator()->has_read_problems()) m_docStatus = PDF_DATAAVAIL_ERROR; diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp index c57d65e78e..fffa7f9b00 100644 --- a/core/fpdfapi/parser/cpdf_parser.cpp +++ b/core/fpdfapi/parser/cpdf_parser.cpp @@ -870,7 +870,7 @@ bool CPDF_Parser::RebuildCrossRef() { m_pSyntax->SetPos(pos + i - m_pSyntax->m_HeaderOffset); std::unique_ptr pObj = - m_pSyntax->GetObject(m_pDocument.Get(), 0, 0, true); + m_pSyntax->GetObject(m_pDocument.Get(), 0, 0, false); if (pObj) { if (pObj->IsDictionary() || pObj->AsStream()) { CPDF_Stream* pStream = pObj->AsStream(); @@ -1232,7 +1232,7 @@ std::unique_ptr CPDF_Parser::ParseIndirectObject( return nullptr; syntax.SetPos(offset + it->second); - return syntax.GetObject(pObjList, 0, 0, true); + return syntax.GetObject(pObjList, 0, 0, false); } CFX_RetainPtr CPDF_Parser::GetObjectStream(uint32_t objnum) { @@ -1328,7 +1328,7 @@ std::unique_ptr CPDF_Parser::LoadTrailerV4() { if (m_pSyntax->GetKeyword() != "trailer") return nullptr; - return ToDictionary(m_pSyntax->GetObject(m_pDocument.Get(), 0, 0, true)); + return ToDictionary(m_pSyntax->GetObject(m_pDocument.Get(), 0, 0, false)); } uint32_t CPDF_Parser::GetPermissions() const { @@ -1365,7 +1365,7 @@ bool CPDF_Parser::ParseLinearizedHeader() { } m_pLinearized = CPDF_LinearizedHeader::CreateForObject( - m_pSyntax->GetObject(nullptr, objnum, gennum, true)); + m_pSyntax->GetObject(nullptr, objnum, gennum, false)); if (!m_pLinearized) return false; -- cgit v1.2.3