| 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 "core/include/fpdfapi/fpdf_parser.h" | 7 #include "core/include/fpdfapi/fpdf_parser.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 | 966 |
| 967 *pos = pStream->GetDict()->GetIntegerBy("Prev"); | 967 *pos = pStream->GetDict()->GetIntegerBy("Prev"); |
| 968 int32_t size = pStream->GetDict()->GetIntegerBy("Size"); | 968 int32_t size = pStream->GetDict()->GetIntegerBy("Size"); |
| 969 if (size < 0) { | 969 if (size < 0) { |
| 970 pStream->Release(); | 970 pStream->Release(); |
| 971 return FALSE; | 971 return FALSE; |
| 972 } | 972 } |
| 973 if (bMainXRef) { | 973 if (bMainXRef) { |
| 974 m_pTrailer = ToDictionary(pStream->GetDict()->Clone()); | 974 m_pTrailer = ToDictionary(pStream->GetDict()->Clone()); |
| 975 ShrinkObjectMap(size); | 975 ShrinkObjectMap(size); |
| 976 for (auto it : m_ObjectInfo) | 976 for (auto& it : m_ObjectInfo) |
| 977 it.second.type = 0; | 977 it.second.type = 0; |
| 978 } else { | 978 } else { |
| 979 m_Trailers.Add(ToDictionary(pStream->GetDict()->Clone())); | 979 m_Trailers.Add(ToDictionary(pStream->GetDict()->Clone())); |
| 980 } | 980 } |
| 981 std::vector<std::pair<int32_t, int32_t> > arrIndex; | 981 std::vector<std::pair<int32_t, int32_t> > arrIndex; |
| 982 CPDF_Array* pArray = pStream->GetDict()->GetArrayBy("Index"); | 982 CPDF_Array* pArray = pStream->GetDict()->GetArrayBy("Index"); |
| 983 if (pArray) { | 983 if (pArray) { |
| 984 FX_DWORD nPairSize = pArray->GetCount() / 2; | 984 FX_DWORD nPairSize = pArray->GetCount() / 2; |
| 985 for (FX_DWORD i = 0; i < nPairSize; i++) { | 985 for (FX_DWORD i = 0; i < nPairSize; i++) { |
| 986 CPDF_Object* pStartNumObj = pArray->GetElement(i * 2); | 986 CPDF_Object* pStartNumObj = pArray->GetElement(i * 2); |
| (...skipping 3735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4722 if (!m_pLinearizedDict) | 4722 if (!m_pLinearizedDict) |
| 4723 return -1; | 4723 return -1; |
| 4724 CPDF_Array* pRange = m_pLinearizedDict->GetArrayBy("H"); | 4724 CPDF_Array* pRange = m_pLinearizedDict->GetArrayBy("H"); |
| 4725 if (!pRange) | 4725 if (!pRange) |
| 4726 return -1; | 4726 return -1; |
| 4727 CPDF_Object* pStreamLen = pRange->GetElementValue(1); | 4727 CPDF_Object* pStreamLen = pRange->GetElementValue(1); |
| 4728 if (!pStreamLen) | 4728 if (!pStreamLen) |
| 4729 return -1; | 4729 return -1; |
| 4730 return pStreamLen->GetInteger(); | 4730 return pStreamLen->GetInteger(); |
| 4731 } | 4731 } |
| OLD | NEW |