From c09625ca59701fabeb49dc59edcf33031b2c6672 Mon Sep 17 00:00:00 2001 From: tsepez Date: Mon, 7 Nov 2016 11:46:09 -0800 Subject: Rename CPDF_Linearized to CPDF_LinearizedHeader My OCD insists that classes be named after nouns, and "linearized" feels like an adjective. Remove a redundant "if" while at it. Review-Url: https://codereview.chromium.org/2482973002 --- BUILD.gn | 4 +- core/fpdfapi/parser/cpdf_data_avail.cpp | 4 +- core/fpdfapi/parser/cpdf_data_avail.h | 4 +- core/fpdfapi/parser/cpdf_document.cpp | 4 +- core/fpdfapi/parser/cpdf_document.h | 4 +- core/fpdfapi/parser/cpdf_document_unittest.cpp | 7 +-- core/fpdfapi/parser/cpdf_hint_tables.cpp | 4 +- core/fpdfapi/parser/cpdf_hint_tables.h | 7 +-- core/fpdfapi/parser/cpdf_linearized.cpp | 71 -------------------------- core/fpdfapi/parser/cpdf_linearized.h | 55 -------------------- core/fpdfapi/parser/cpdf_linearized_header.cpp | 69 +++++++++++++++++++++++++ core/fpdfapi/parser/cpdf_linearized_header.h | 55 ++++++++++++++++++++ core/fpdfapi/parser/cpdf_parser.cpp | 4 +- core/fpdfapi/parser/cpdf_parser.h | 4 +- testing/libfuzzer/pdf_hint_table_fuzzer.cc | 6 +-- 15 files changed, 151 insertions(+), 151 deletions(-) delete mode 100644 core/fpdfapi/parser/cpdf_linearized.cpp delete mode 100644 core/fpdfapi/parser/cpdf_linearized.h create mode 100644 core/fpdfapi/parser/cpdf_linearized_header.cpp create mode 100644 core/fpdfapi/parser/cpdf_linearized_header.h diff --git a/BUILD.gn b/BUILD.gn index 5a6cf1418d..9a8bf07f20 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -500,8 +500,8 @@ static_library("fpdfapi") { "core/fpdfapi/parser/cpdf_hint_tables.h", "core/fpdfapi/parser/cpdf_indirect_object_holder.cpp", "core/fpdfapi/parser/cpdf_indirect_object_holder.h", - "core/fpdfapi/parser/cpdf_linearized.cpp", - "core/fpdfapi/parser/cpdf_linearized.h", + "core/fpdfapi/parser/cpdf_linearized_header.cpp", + "core/fpdfapi/parser/cpdf_linearized_header.h", "core/fpdfapi/parser/cpdf_name.cpp", "core/fpdfapi/parser/cpdf_name.h", "core/fpdfapi/parser/cpdf_null.cpp", diff --git a/core/fpdfapi/parser/cpdf_data_avail.cpp b/core/fpdfapi/parser/cpdf_data_avail.cpp index e6d2c61ad3..1f43a4bdfe 100644 --- a/core/fpdfapi/parser/cpdf_data_avail.cpp +++ b/core/fpdfapi/parser/cpdf_data_avail.cpp @@ -15,7 +15,7 @@ #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_document.h" #include "core/fpdfapi/parser/cpdf_hint_tables.h" -#include "core/fpdfapi/parser/cpdf_linearized.h" +#include "core/fpdfapi/parser/cpdf_linearized_header.h" #include "core/fpdfapi/parser/cpdf_name.h" #include "core/fpdfapi/parser/cpdf_number.h" #include "core/fpdfapi/parser/cpdf_reference.h" @@ -783,7 +783,7 @@ bool CPDF_DataAvail::IsLinearizedFile(uint8_t* pData, uint32_t dwLen) { return false; uint32_t objnum = FXSYS_atoui(wordObjNum.c_str()); - m_pLinearized = CPDF_Linearized::CreateForObject(pdfium::WrapUnique( + m_pLinearized = CPDF_LinearizedHeader::CreateForObject(pdfium::WrapUnique( ParseIndirectObjectAt(m_syntaxParser.m_HeaderOffset + 9, objnum))); if (!m_pLinearized || m_pLinearized->GetFileSize() != m_pFileRead->GetSize()) { diff --git a/core/fpdfapi/parser/cpdf_data_avail.h b/core/fpdfapi/parser/cpdf_data_avail.h index bff9f2943b..e4fc7bad8b 100644 --- a/core/fpdfapi/parser/cpdf_data_avail.h +++ b/core/fpdfapi/parser/cpdf_data_avail.h @@ -16,7 +16,7 @@ class CPDF_Dictionary; class CPDF_HintTables; class CPDF_IndirectObjectHolder; -class CPDF_Linearized; +class CPDF_LinearizedHeader; class CPDF_Parser; enum PDF_DATAAVAIL_STATUS { @@ -200,7 +200,7 @@ class CPDF_DataAvail final { CPDF_Object* m_pRoot; uint32_t m_dwRootObjNum; uint32_t m_dwInfoObjNum; - std::unique_ptr m_pLinearized; + std::unique_ptr m_pLinearized; CPDF_Object* m_pTrailer; bool m_bDocAvail; FX_FILESIZE m_dwHeaderOffset; diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp index d9ffc0b28a..eb2ab554c7 100644 --- a/core/fpdfapi/parser/cpdf_document.cpp +++ b/core/fpdfapi/parser/cpdf_document.cpp @@ -17,7 +17,7 @@ #include "core/fpdfapi/page/pageint.h" #include "core/fpdfapi/parser/cpdf_array.h" #include "core/fpdfapi/parser/cpdf_dictionary.h" -#include "core/fpdfapi/parser/cpdf_linearized.h" +#include "core/fpdfapi/parser/cpdf_linearized_header.h" #include "core/fpdfapi/parser/cpdf_number.h" #include "core/fpdfapi/parser/cpdf_parser.h" #include "core/fpdfapi/parser/cpdf_reference.h" @@ -380,7 +380,7 @@ void CPDF_Document::LoadDoc() { } void CPDF_Document::LoadLinearizedDoc( - const CPDF_Linearized* pLinearizationParams) { + const CPDF_LinearizedHeader* pLinearizationParams) { m_bLinearized = true; LoadDocInternal(); m_PageList.SetSize(pLinearizationParams->GetPageCount()); diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h index 1b18015200..cf1bcae6b5 100644 --- a/core/fpdfapi/parser/cpdf_document.h +++ b/core/fpdfapi/parser/cpdf_document.h @@ -26,7 +26,7 @@ class CPDF_Font; class CPDF_FontEncoding; class CPDF_IccProfile; class CPDF_Image; -class CPDF_Linearized; +class CPDF_LinearizedHeader; class CPDF_Parser; class CPDF_Pattern; class CPDF_StreamAcc; @@ -86,7 +86,7 @@ class CPDF_Document : public CPDF_IndirectObjectHolder { CPDF_IccProfile* LoadIccProfile(CPDF_Stream* pStream); void LoadDoc(); - void LoadLinearizedDoc(const CPDF_Linearized* pLinearizationParams); + void LoadLinearizedDoc(const CPDF_LinearizedHeader* pLinearizationParams); void LoadPages(); void CreateNewDoc(); diff --git a/core/fpdfapi/parser/cpdf_document_unittest.cpp b/core/fpdfapi/parser/cpdf_document_unittest.cpp index e20a5a1d1d..7b5ab43b5c 100644 --- a/core/fpdfapi/parser/cpdf_document_unittest.cpp +++ b/core/fpdfapi/parser/cpdf_document_unittest.cpp @@ -9,7 +9,7 @@ #include "core/fpdfapi/cpdf_modulemgr.h" #include "core/fpdfapi/parser/cpdf_array.h" #include "core/fpdfapi/parser/cpdf_dictionary.h" -#include "core/fpdfapi/parser/cpdf_linearized.h" +#include "core/fpdfapi/parser/cpdf_linearized_header.h" #include "core/fpdfapi/parser/cpdf_parser.h" #include "core/fxcrt/fx_memory.h" #include "testing/gtest/include/gtest/gtest.h" @@ -76,9 +76,10 @@ class CPDF_TestDocumentForPages : public CPDF_Document { std::unique_ptr m_pOwnedRootDict; }; -class TestLinearized : public CPDF_Linearized { +class TestLinearized : public CPDF_LinearizedHeader { public: - explicit TestLinearized(CPDF_Dictionary* dict) : CPDF_Linearized(dict) {} + explicit TestLinearized(CPDF_Dictionary* dict) + : CPDF_LinearizedHeader(dict) {} }; } // namespace diff --git a/core/fpdfapi/parser/cpdf_hint_tables.cpp b/core/fpdfapi/parser/cpdf_hint_tables.cpp index bbc57dace9..5c0f2a7fbe 100644 --- a/core/fpdfapi/parser/cpdf_hint_tables.cpp +++ b/core/fpdfapi/parser/cpdf_hint_tables.cpp @@ -12,7 +12,7 @@ #include "core/fpdfapi/parser/cpdf_data_avail.h" #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_document.h" -#include "core/fpdfapi/parser/cpdf_linearized.h" +#include "core/fpdfapi/parser/cpdf_linearized_header.h" #include "core/fpdfapi/parser/cpdf_stream.h" #include "core/fpdfapi/parser/cpdf_stream_acc.h" #include "core/fxcrt/fx_safe_types.h" @@ -35,7 +35,7 @@ bool IsValidPageOffsetHintTableBitCount(uint32_t bits) { } // namespace CPDF_HintTables::CPDF_HintTables(CPDF_DataAvail* pDataAvail, - CPDF_Linearized* pLinearized) + CPDF_LinearizedHeader* pLinearized) : m_pDataAvail(pDataAvail), m_pLinearized(pLinearized), m_nFirstPageSharedObjs(0), diff --git a/core/fpdfapi/parser/cpdf_hint_tables.h b/core/fpdfapi/parser/cpdf_hint_tables.h index 68b5059b05..e0bc6e0751 100644 --- a/core/fpdfapi/parser/cpdf_hint_tables.h +++ b/core/fpdfapi/parser/cpdf_hint_tables.h @@ -14,12 +14,13 @@ #include "core/fxcrt/fx_stream.h" class CFX_BitStream; -class CPDF_Linearized; +class CPDF_LinearizedHeader; class CPDF_Stream; class CPDF_HintTables { public: - CPDF_HintTables(CPDF_DataAvail* pDataAvail, CPDF_Linearized* pLinearized); + CPDF_HintTables(CPDF_DataAvail* pDataAvail, + CPDF_LinearizedHeader* pLinearized); virtual ~CPDF_HintTables(); bool GetPagePos(uint32_t index, @@ -53,7 +54,7 @@ class CPDF_HintTables { CPDF_DataAvail* const m_pDataAvail; // Owned by |m_pDataAvail|. - CPDF_Linearized* const m_pLinearized; + CPDF_LinearizedHeader* const m_pLinearized; uint32_t m_nFirstPageSharedObjs; FX_FILESIZE m_szFirstPageObjOffset; diff --git a/core/fpdfapi/parser/cpdf_linearized.cpp b/core/fpdfapi/parser/cpdf_linearized.cpp deleted file mode 100644 index ec57f100cb..0000000000 --- a/core/fpdfapi/parser/cpdf_linearized.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#include "core/fpdfapi/parser/cpdf_linearized.h" - -#include "core/fpdfapi/parser/cpdf_array.h" -#include "core/fpdfapi/parser/cpdf_dictionary.h" -#include "core/fpdfapi/parser/cpdf_number.h" -#include "third_party/base/ptr_util.h" - -namespace { - -template -bool IsValidNumericDictionaryValue(const CPDF_Dictionary* pDict, - const char* key, - T min_value, - bool must_exist = true) { - if (!pDict->KeyExist(key)) - return !must_exist; - const CPDF_Number* pNum = ToNumber(pDict->GetObjectFor(key)); - if (!pNum || !pNum->IsInteger()) - return false; - const int raw_value = pNum->GetInteger(); - if (!pdfium::base::IsValueInRangeForNumericType(raw_value)) - return false; - return static_cast(raw_value) >= min_value; -} - -} // namespace - -// static -std::unique_ptr CPDF_Linearized::CreateForObject( - std::unique_ptr pObj) { - auto pDict = ToDictionary(std::move(pObj)); - if (!pDict || !pDict->KeyExist("Linearized") || - !IsValidNumericDictionaryValue(pDict.get(), "L", 1) || - !IsValidNumericDictionaryValue(pDict.get(), "P", 0, false) || - !IsValidNumericDictionaryValue(pDict.get(), "T", 1) || - !IsValidNumericDictionaryValue(pDict.get(), "N", 0) || - !IsValidNumericDictionaryValue(pDict.get(), "E", 1) || - !IsValidNumericDictionaryValue(pDict.get(), "O", 1)) - return nullptr; - return pdfium::WrapUnique(new CPDF_Linearized(pDict.get())); -} - -CPDF_Linearized::CPDF_Linearized(const CPDF_Dictionary* pDict) { - if (!pDict) - return; - m_szFileSize = pDict->GetIntegerFor("L"); - m_dwFirstPageNo = pDict->GetIntegerFor("P"); - m_szLastXRefOffset = pDict->GetIntegerFor("T"); - m_PageCount = pDict->GetIntegerFor("N"); - m_szFirstPageEndOffset = pDict->GetIntegerFor("E"); - m_FirstPageObjNum = pDict->GetIntegerFor("O"); - const CPDF_Array* pHintStreamRange = pDict->GetArrayFor("H"); - const size_t nHintStreamSize = - pHintStreamRange ? pHintStreamRange->GetCount() : 0; - if (nHintStreamSize == 2 || nHintStreamSize == 4) { - m_szHintStart = std::max(pHintStreamRange->GetIntegerAt(0), 0); - m_szHintLength = std::max(pHintStreamRange->GetIntegerAt(1), 0); - } -} - -CPDF_Linearized::~CPDF_Linearized() {} - -bool CPDF_Linearized::HasHintTable() const { - return GetPageCount() > 1 && GetHintStart() > 0 && GetHintLength() > 0; -} diff --git a/core/fpdfapi/parser/cpdf_linearized.h b/core/fpdfapi/parser/cpdf_linearized.h deleted file mode 100644 index caf538e3fe..0000000000 --- a/core/fpdfapi/parser/cpdf_linearized.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef CORE_FPDFAPI_PARSER_CPDF_LINEARIZED_H_ -#define CORE_FPDFAPI_PARSER_CPDF_LINEARIZED_H_ - -#include - -#include "core/fxcrt/fx_memory.h" -#include "core/fxcrt/fx_stream.h" - -class CPDF_Dictionary; -class CPDF_Object; - -class CPDF_Linearized { - public: - ~CPDF_Linearized(); - static std::unique_ptr CreateForObject( - std::unique_ptr pObj); - - // Will only return values > 0. - FX_FILESIZE GetFileSize() const { return m_szFileSize; } - uint32_t GetFirstPageNo() const { return m_dwFirstPageNo; } - // Will only return values > 0. - FX_FILESIZE GetLastXRefOffset() const { return m_szLastXRefOffset; } - uint32_t GetPageCount() const { return m_PageCount; } - // Will only return values > 0. - FX_FILESIZE GetFirstPageEndOffset() const { return m_szFirstPageEndOffset; } - // Will only return values > 0. - uint32_t GetFirstPageObjNum() const { return m_FirstPageObjNum; } - - bool HasHintTable() const; - // Will only return values > 0. - FX_FILESIZE GetHintStart() const { return m_szHintStart; } - // Will only return values > 0. - FX_FILESIZE GetHintLength() const { return m_szHintLength; } - - protected: - explicit CPDF_Linearized(const CPDF_Dictionary* pDict); - - private: - FX_FILESIZE m_szFileSize = 0; - uint32_t m_dwFirstPageNo = 0; - FX_FILESIZE m_szLastXRefOffset = 0; - uint32_t m_PageCount = 0; - FX_FILESIZE m_szFirstPageEndOffset = 0; - uint32_t m_FirstPageObjNum = 0; - FX_FILESIZE m_szHintStart = 0; - FX_FILESIZE m_szHintLength = 0; -}; - -#endif // CORE_FPDFAPI_PARSER_CPDF_LINEARIZED_H_ diff --git a/core/fpdfapi/parser/cpdf_linearized_header.cpp b/core/fpdfapi/parser/cpdf_linearized_header.cpp new file mode 100644 index 0000000000..9ecc051f8a --- /dev/null +++ b/core/fpdfapi/parser/cpdf_linearized_header.cpp @@ -0,0 +1,69 @@ +// Copyright 2016 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "core/fpdfapi/parser/cpdf_linearized_header.h" + +#include "core/fpdfapi/parser/cpdf_array.h" +#include "core/fpdfapi/parser/cpdf_dictionary.h" +#include "core/fpdfapi/parser/cpdf_number.h" +#include "third_party/base/ptr_util.h" + +namespace { + +template +bool IsValidNumericDictionaryValue(const CPDF_Dictionary* pDict, + const char* key, + T min_value, + bool must_exist = true) { + if (!pDict->KeyExist(key)) + return !must_exist; + const CPDF_Number* pNum = ToNumber(pDict->GetObjectFor(key)); + if (!pNum || !pNum->IsInteger()) + return false; + const int raw_value = pNum->GetInteger(); + if (!pdfium::base::IsValueInRangeForNumericType(raw_value)) + return false; + return static_cast(raw_value) >= min_value; +} + +} // namespace + +// static +std::unique_ptr CPDF_LinearizedHeader::CreateForObject( + std::unique_ptr pObj) { + auto pDict = ToDictionary(std::move(pObj)); + if (!pDict || !pDict->KeyExist("Linearized") || + !IsValidNumericDictionaryValue(pDict.get(), "L", 1) || + !IsValidNumericDictionaryValue(pDict.get(), "P", 0, false) || + !IsValidNumericDictionaryValue(pDict.get(), "T", 1) || + !IsValidNumericDictionaryValue(pDict.get(), "N", 0) || + !IsValidNumericDictionaryValue(pDict.get(), "E", 1) || + !IsValidNumericDictionaryValue(pDict.get(), "O", 1)) + return nullptr; + return pdfium::WrapUnique(new CPDF_LinearizedHeader(pDict.get())); +} + +CPDF_LinearizedHeader::CPDF_LinearizedHeader(const CPDF_Dictionary* pDict) { + m_szFileSize = pDict->GetIntegerFor("L"); + m_dwFirstPageNo = pDict->GetIntegerFor("P"); + m_szLastXRefOffset = pDict->GetIntegerFor("T"); + m_PageCount = pDict->GetIntegerFor("N"); + m_szFirstPageEndOffset = pDict->GetIntegerFor("E"); + m_FirstPageObjNum = pDict->GetIntegerFor("O"); + const CPDF_Array* pHintStreamRange = pDict->GetArrayFor("H"); + const size_t nHintStreamSize = + pHintStreamRange ? pHintStreamRange->GetCount() : 0; + if (nHintStreamSize == 2 || nHintStreamSize == 4) { + m_szHintStart = std::max(pHintStreamRange->GetIntegerAt(0), 0); + m_szHintLength = std::max(pHintStreamRange->GetIntegerAt(1), 0); + } +} + +CPDF_LinearizedHeader::~CPDF_LinearizedHeader() {} + +bool CPDF_LinearizedHeader::HasHintTable() const { + return GetPageCount() > 1 && GetHintStart() > 0 && GetHintLength() > 0; +} diff --git a/core/fpdfapi/parser/cpdf_linearized_header.h b/core/fpdfapi/parser/cpdf_linearized_header.h new file mode 100644 index 0000000000..0d6d725f00 --- /dev/null +++ b/core/fpdfapi/parser/cpdf_linearized_header.h @@ -0,0 +1,55 @@ +// Copyright 2016 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef CORE_FPDFAPI_PARSER_CPDF_LINEARIZED_HEADER_H_ +#define CORE_FPDFAPI_PARSER_CPDF_LINEARIZED_HEADER_H_ + +#include + +#include "core/fxcrt/fx_memory.h" +#include "core/fxcrt/fx_stream.h" + +class CPDF_Dictionary; +class CPDF_Object; + +class CPDF_LinearizedHeader { + public: + ~CPDF_LinearizedHeader(); + static std::unique_ptr CreateForObject( + std::unique_ptr pObj); + + // Will only return values > 0. + FX_FILESIZE GetFileSize() const { return m_szFileSize; } + uint32_t GetFirstPageNo() const { return m_dwFirstPageNo; } + // Will only return values > 0. + FX_FILESIZE GetLastXRefOffset() const { return m_szLastXRefOffset; } + uint32_t GetPageCount() const { return m_PageCount; } + // Will only return values > 0. + FX_FILESIZE GetFirstPageEndOffset() const { return m_szFirstPageEndOffset; } + // Will only return values > 0. + uint32_t GetFirstPageObjNum() const { return m_FirstPageObjNum; } + + bool HasHintTable() const; + // Will only return values > 0. + FX_FILESIZE GetHintStart() const { return m_szHintStart; } + // Will only return values > 0. + FX_FILESIZE GetHintLength() const { return m_szHintLength; } + + protected: + explicit CPDF_LinearizedHeader(const CPDF_Dictionary* pDict); + + private: + FX_FILESIZE m_szFileSize = 0; + uint32_t m_dwFirstPageNo = 0; + FX_FILESIZE m_szLastXRefOffset = 0; + uint32_t m_PageCount = 0; + FX_FILESIZE m_szFirstPageEndOffset = 0; + uint32_t m_FirstPageObjNum = 0; + FX_FILESIZE m_szHintStart = 0; + FX_FILESIZE m_szHintLength = 0; +}; + +#endif // CORE_FPDFAPI_PARSER_CPDF_LINEARIZED_HEADER_H_ diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp index 044d12d6ef..74136efbd8 100644 --- a/core/fpdfapi/parser/cpdf_parser.cpp +++ b/core/fpdfapi/parser/cpdf_parser.cpp @@ -12,7 +12,7 @@ #include "core/fpdfapi/parser/cpdf_crypto_handler.h" #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_document.h" -#include "core/fpdfapi/parser/cpdf_linearized.h" +#include "core/fpdfapi/parser/cpdf_linearized_header.h" #include "core/fpdfapi/parser/cpdf_number.h" #include "core/fpdfapi/parser/cpdf_reference.h" #include "core/fpdfapi/parser/cpdf_security_handler.h" @@ -1449,7 +1449,7 @@ bool CPDF_Parser::IsLinearizedFile(IFX_SeekableReadStream* pFileAccess, return false; } - m_pLinearized = CPDF_Linearized::CreateForObject( + m_pLinearized = CPDF_LinearizedHeader::CreateForObject( pdfium::WrapUnique(m_pSyntax->GetObject(nullptr, objnum, gennum, true))); if (!m_pLinearized) return false; diff --git a/core/fpdfapi/parser/cpdf_parser.h b/core/fpdfapi/parser/cpdf_parser.h index b8ce7ab294..faac6c5195 100644 --- a/core/fpdfapi/parser/cpdf_parser.h +++ b/core/fpdfapi/parser/cpdf_parser.h @@ -19,7 +19,7 @@ class CPDF_CryptoHandler; class CPDF_Dictionary; class CPDF_Document; class CPDF_IndirectObjectHolder; -class CPDF_Linearized; +class CPDF_LinearizedHeader; class CPDF_Object; class CPDF_SecurityHandler; class CPDF_StreamAcc; @@ -158,7 +158,7 @@ class CPDF_Parser { std::set m_SortedOffset; std::vector m_Trailers; bool m_bVersionUpdated; - std::unique_ptr m_pLinearized; + std::unique_ptr m_pLinearized; uint32_t m_dwXrefStartObjNum; // A map of object numbers to indirect streams. Map owns the streams. diff --git a/testing/libfuzzer/pdf_hint_table_fuzzer.cc b/testing/libfuzzer/pdf_hint_table_fuzzer.cc index ec51517fc0..e4606f6160 100644 --- a/testing/libfuzzer/pdf_hint_table_fuzzer.cc +++ b/testing/libfuzzer/pdf_hint_table_fuzzer.cc @@ -20,7 +20,7 @@ int32_t GetData(const int32_t** data32, const uint8_t** data, size_t* size) { class HintTableForFuzzing : public CPDF_HintTables { public: - HintTableForFuzzing(CPDF_Linearized* pLinearized, + HintTableForFuzzing(CPDF_LinearizedHeader* pLinearized, int shared_hint_table_offset) : CPDF_HintTables(nullptr, pLinearized), shared_hint_table_offset_(shared_hint_table_offset) {} @@ -44,10 +44,10 @@ class HintTableForFuzzing : public CPDF_HintTables { int shared_hint_table_offset_; }; -class FakeLinearized : public CPDF_Linearized { +class FakeLinearized : public CPDF_LinearizedHeader { public: explicit FakeLinearized(CPDF_Dictionary* linearized_dict) - : CPDF_Linearized(linearized_dict) {} + : CPDF_LinearizedHeader(linearized_dict) {} }; extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { -- cgit v1.2.3