From aa50728980036f07fda232cea974fd80c89b7cb7 Mon Sep 17 00:00:00 2001 From: Artem Strygin Date: Tue, 24 Jul 2018 10:14:24 +0000 Subject: Fix encryption dictionary owning. Return encryption dictionary as const reference from CPDF_Parser. Create a copy in CPDF_Creator if needed. Change-Id: I270f71d307d818fba7f65ebe379f5942ae816934 Reviewed-on: https://pdfium-review.googlesource.com/38390 Reviewed-by: Lei Zhang Commit-Queue: Art Snake --- core/fpdfapi/parser/cpdf_parser.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'core/fpdfapi/parser/cpdf_parser.h') diff --git a/core/fpdfapi/parser/cpdf_parser.h b/core/fpdfapi/parser/cpdf_parser.h index 92aaf7df6a..0af39d7529 100644 --- a/core/fpdfapi/parser/cpdf_parser.h +++ b/core/fpdfapi/parser/cpdf_parser.h @@ -78,7 +78,7 @@ class CPDF_Parser { const CPDF_Array* GetIDArray() const; CPDF_Dictionary* GetRoot() const; - CPDF_Dictionary* GetEncryptDict() const { return m_pEncryptDict.get(); } + const CPDF_Dictionary* GetEncryptDict() const; std::unique_ptr ParseIndirectObject(uint32_t objnum); @@ -141,7 +141,6 @@ class CPDF_Parser { Error LoadLinearizedMainXRefTable(); const CPDF_ObjectStream* GetObjectStream(uint32_t object_number); std::unique_ptr ParseLinearizedHeader(); - void SetEncryptDictionary(const CPDF_Dictionary* pDict); void ShrinkObjectMap(uint32_t size); // A simple check whether the cross reference table matches with // the objects. @@ -172,7 +171,6 @@ class CPDF_Parser { // m_CrossRefTable must be destroyed after m_pSecurityHandler due to the // ownership of the ID array data. std::unique_ptr m_CrossRefTable; - std::unique_ptr m_pEncryptDict; FX_FILESIZE m_LastXRefOffset; std::unique_ptr m_pSecurityHandler; ByteString m_Password; -- cgit v1.2.3