From 90c964fb069bfa9934493481f8ccfefef9c3b3fe Mon Sep 17 00:00:00 2001 From: weili Date: Fri, 22 Apr 2016 15:25:14 -0700 Subject: Add a simple check for V4 cross reference table Some unknown software generates cross reference table with the claimed object numbers are all off by one. Add a simple verification function to detect this scenario, thus have a chance to rebuild the correct cross reference table. To avoid unnecessary checks and potiential performance hit, we only check for the very first non free entry. BUG=602650 Review URL: https://codereview.chromium.org/1910063004 --- core/fpdfapi/fpdf_parser/include/cpdf_parser.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/fpdfapi/fpdf_parser/include/cpdf_parser.h') diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_parser.h b/core/fpdfapi/fpdf_parser/include/cpdf_parser.h index 5331ccafb1..48511e9263 100644 --- a/core/fpdfapi/fpdf_parser/include/cpdf_parser.h +++ b/core/fpdfapi/fpdf_parser/include/cpdf_parser.h @@ -114,6 +114,9 @@ class CPDF_Parser { FX_BOOL IsLinearizedFile(IFX_FileRead* pFileAccess, uint32_t offset); void SetEncryptDictionary(CPDF_Dictionary* pDict); void ShrinkObjectMap(uint32_t size); + // A simple check whether the cross reference table matches with + // the objects. + bool VerifyCrossRefV4(); CPDF_Document* m_pDocument; std::unique_ptr m_pSyntax; -- cgit v1.2.3