Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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 "parser_int.h" | |
|
Lei Zhang
2016/01/06 00:05:33
This one was wrong. I should have put core/include
Wei Li
2016/01/06 04:46:24
Done.
| |
| 8 | |
| 9 #include <algorithm> | 7 #include <algorithm> |
| 10 #include <memory> | 8 #include <memory> |
| 11 #include <set> | 9 #include <set> |
| 12 #include <utility> | 10 #include <utility> |
| 13 #include <vector> | 11 #include <vector> |
| 14 | 12 |
| 15 #include "core/include/fpdfapi/fpdf_module.h" | 13 #include "core/include/fpdfapi/fpdf_module.h" |
| 16 #include "core/include/fpdfapi/fpdf_page.h" | 14 #include "core/include/fpdfapi/fpdf_page.h" |
| 17 #include "core/include/fpdfapi/fpdf_parser.h" | 15 #include "core/include/fpdfapi/fpdf_parser.h" |
| 18 #include "core/include/fxcrt/fx_ext.h" | 16 #include "core/include/fxcrt/fx_ext.h" |
| 19 #include "core/include/fxcrt/fx_safe_types.h" | 17 #include "core/include/fxcrt/fx_safe_types.h" |
| 20 #include "core/src/fpdfapi/fpdf_page/pageint.h" | 18 #include "core/src/fpdfapi/fpdf_page/pageint.h" |
| 19 #include "core/src/fpdfapi/fpdf_parser/parser_int.h" | |
| 21 #include "third_party/base/stl_util.h" | 20 #include "third_party/base/stl_util.h" |
| 22 | 21 |
| 23 namespace { | 22 namespace { |
| 24 | 23 |
| 25 // A limit on the size of the xref table. Theoretical limits are higher, but | 24 // A limit on the size of the xref table. Theoretical limits are higher, but |
| 26 // this may be large enough in practice. | 25 // this may be large enough in practice. |
| 27 const int32_t kMaxXRefSize = 1048576; | 26 const int32_t kMaxXRefSize = 1048576; |
| 28 | 27 |
| 29 // A limit on the maximum object number in the xref table. Theoretical limits | 28 // A limit on the maximum object number in the xref table. Theoretical limits |
| 30 // are higher, but this may be large enough in practice. | 29 // are higher, but this may be large enough in practice. |
| (...skipping 4966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4997 if (!m_pLinearizedDict) | 4996 if (!m_pLinearizedDict) |
| 4998 return -1; | 4997 return -1; |
| 4999 CPDF_Array* pRange = m_pLinearizedDict->GetArray("H"); | 4998 CPDF_Array* pRange = m_pLinearizedDict->GetArray("H"); |
| 5000 if (!pRange) | 4999 if (!pRange) |
| 5001 return -1; | 5000 return -1; |
| 5002 CPDF_Object* pStreamLen = pRange->GetElementValue(1); | 5001 CPDF_Object* pStreamLen = pRange->GetElementValue(1); |
| 5003 if (!pStreamLen) | 5002 if (!pStreamLen) |
| 5004 return -1; | 5003 return -1; |
| 5005 return pStreamLen->GetInteger(); | 5004 return pStreamLen->GetInteger(); |
| 5006 } | 5005 } |
| OLD | NEW |