| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "core/include/fpdfapi/cpdf_parser.h" | 7 #include "core/include/fpdfapi/cpdf_parser.h" |
| 8 | 8 |
| 9 #include "core/include/fpdfapi/cpdf_document.h" | 9 #include "core/include/fpdfapi/cpdf_document.h" |
| 10 #include "core/include/fpdfapi/fpdf_parser.h" | 10 #include "core/include/fpdfapi/fpdf_parser.h" |
| 11 #include "core/include/fxcrt/fx_ext.h" | 11 #include "core/include/fxcrt/fx_ext.h" |
| 12 #include "core/include/fxcrt/fx_safe_types.h" | 12 #include "core/include/fxcrt/fx_safe_types.h" |
| 13 #include "core/src/fpdfapi/fpdf_parser/cpdf_standard_security_handler.h" |
| 13 #include "core/src/fpdfapi/fpdf_parser/cpdf_syntax_parser.h" | 14 #include "core/src/fpdfapi/fpdf_parser/cpdf_syntax_parser.h" |
| 14 #include "core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.h" | 15 #include "core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.h" |
| 15 #include "third_party/base/stl_util.h" | 16 #include "third_party/base/stl_util.h" |
| 16 | 17 |
| 17 namespace { | 18 namespace { |
| 18 | 19 |
| 19 // A limit on the size of the xref table. Theoretical limits are higher, but | 20 // A limit on the size of the xref table. Theoretical limits are higher, but |
| 20 // this may be large enough in practice. | 21 // this may be large enough in practice. |
| 21 const int32_t kMaxXRefSize = 1048576; | 22 const int32_t kMaxXRefSize = 1048576; |
| 22 | 23 |
| (...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1634 if (!LoadLinearizedAllCrossRefV4(m_LastXRefOffset, m_dwXrefStartObjNum) && | 1635 if (!LoadLinearizedAllCrossRefV4(m_LastXRefOffset, m_dwXrefStartObjNum) && |
| 1635 !LoadLinearizedAllCrossRefV5(m_LastXRefOffset)) { | 1636 !LoadLinearizedAllCrossRefV5(m_LastXRefOffset)) { |
| 1636 m_LastXRefOffset = 0; | 1637 m_LastXRefOffset = 0; |
| 1637 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; | 1638 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; |
| 1638 return FORMAT_ERROR; | 1639 return FORMAT_ERROR; |
| 1639 } | 1640 } |
| 1640 | 1641 |
| 1641 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; | 1642 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; |
| 1642 return SUCCESS; | 1643 return SUCCESS; |
| 1643 } | 1644 } |
| OLD | NEW |