#include "core/fpdfapi/parser/cpdf_linearized_header.h"
#include <algorithm>
#include <limits>
#include <utility>
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_number.h"
#include "core/fpdfapi/parser/cpdf_parser.h"
#include "core/fpdfapi/parser/cpdf_syntax_parser.h"
#include "core/fxcrt/check.h"
#include "core/fxcrt/fx_safe_types.h"
#include "core/fxcrt/ptr_util.h"
namespace {
constexpr FX_FILESIZE kLinearizedHeaderOffset = …;
constexpr size_t kMaxInt = …;
template <class T>
bool IsValidNumericDictionaryValue(const CPDF_Dictionary* pDict,
const ByteString& key,
T min_value,
bool must_exist = true) { … }
bool IsLinearizedHeaderValid(const CPDF_LinearizedHeader* header,
FX_FILESIZE document_size) { … }
}
std::unique_ptr<CPDF_LinearizedHeader> CPDF_LinearizedHeader::Parse(
CPDF_SyntaxParser* parser) { … }
CPDF_LinearizedHeader::CPDF_LinearizedHeader(const CPDF_Dictionary* pDict,
FX_FILESIZE szLastXRefOffset)
: … { … }
CPDF_LinearizedHeader::~CPDF_LinearizedHeader() = default;
bool CPDF_LinearizedHeader::HasHintTable() const { … }