From 240dec52b2e6502e7deb27a3535af3b1a3e23428 Mon Sep 17 00:00:00 2001 From: art-snake Date: Mon, 7 Nov 2016 08:42:04 -0800 Subject: Reland of Unify some code Unify some code Move parsing of linearized header into separate CPDF_Linearized class. Original review: https://codereview.chromium.org/2466023002/ Revert review: https://codereview.chromium.org/2474283005/ Revert reason was: Breaking the chrome roll. See https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/331856 ___ Added Fix for fuzzers. Review-Url: https://codereview.chromium.org/2477213003 --- core/fpdfapi/parser/cpdf_parser.h | 6 +++--- 1 file changed, 3 insertions(+), 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 3be157a1a2..b8ce7ab294 100644 --- a/core/fpdfapi/parser/cpdf_parser.h +++ b/core/fpdfapi/parser/cpdf_parser.h @@ -19,6 +19,7 @@ class CPDF_CryptoHandler; class CPDF_Dictionary; class CPDF_Document; class CPDF_IndirectObjectHolder; +class CPDF_Linearized; class CPDF_Object; class CPDF_SecurityHandler; class CPDF_StreamAcc; @@ -88,7 +89,7 @@ class CPDF_Parser { uint32_t objnum, FX_FILESIZE* pResultPos); - uint32_t GetFirstPageNo() const { return m_dwFirstPageNo; } + uint32_t GetFirstPageNo() const; protected: struct ObjectInfo { @@ -157,8 +158,7 @@ class CPDF_Parser { std::set m_SortedOffset; std::vector m_Trailers; bool m_bVersionUpdated; - CPDF_Object* m_pLinearized; - uint32_t m_dwFirstPageNo; + std::unique_ptr m_pLinearized; uint32_t m_dwXrefStartObjNum; // A map of object numbers to indirect streams. Map owns the streams. -- cgit v1.2.3