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 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 | 971 |
972 *pos = pStream->GetDict()->GetIntegerBy("Prev"); | 972 *pos = pStream->GetDict()->GetIntegerBy("Prev"); |
973 int32_t size = pStream->GetDict()->GetIntegerBy("Size"); | 973 int32_t size = pStream->GetDict()->GetIntegerBy("Size"); |
974 if (size < 0) { | 974 if (size < 0) { |
975 pStream->Release(); | 975 pStream->Release(); |
976 return FALSE; | 976 return FALSE; |
977 } | 977 } |
978 if (bMainXRef) { | 978 if (bMainXRef) { |
979 m_pTrailer = ToDictionary(pStream->GetDict()->Clone()); | 979 m_pTrailer = ToDictionary(pStream->GetDict()->Clone()); |
980 ShrinkObjectMap(size); | 980 ShrinkObjectMap(size); |
981 for (auto it : m_ObjectInfo) | 981 for (auto& it : m_ObjectInfo) |
982 it.second.type = 0; | 982 it.second.type = 0; |
983 } else { | 983 } else { |
984 m_Trailers.Add(ToDictionary(pStream->GetDict()->Clone())); | 984 m_Trailers.Add(ToDictionary(pStream->GetDict()->Clone())); |
985 } | 985 } |
986 std::vector<std::pair<int32_t, int32_t> > arrIndex; | 986 std::vector<std::pair<int32_t, int32_t> > arrIndex; |
987 CPDF_Array* pArray = pStream->GetDict()->GetArrayBy("Index"); | 987 CPDF_Array* pArray = pStream->GetDict()->GetArrayBy("Index"); |
988 if (pArray) { | 988 if (pArray) { |
989 FX_DWORD nPairSize = pArray->GetCount() / 2; | 989 FX_DWORD nPairSize = pArray->GetCount() / 2; |
990 for (FX_DWORD i = 0; i < nPairSize; i++) { | 990 for (FX_DWORD i = 0; i < nPairSize; i++) { |
991 CPDF_Object* pStartNumObj = pArray->GetElement(i * 2); | 991 CPDF_Object* pStartNumObj = pArray->GetElement(i * 2); |
(...skipping 3735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4727 if (!m_pLinearizedDict) | 4727 if (!m_pLinearizedDict) |
4728 return -1; | 4728 return -1; |
4729 CPDF_Array* pRange = m_pLinearizedDict->GetArrayBy("H"); | 4729 CPDF_Array* pRange = m_pLinearizedDict->GetArrayBy("H"); |
4730 if (!pRange) | 4730 if (!pRange) |
4731 return -1; | 4731 return -1; |
4732 CPDF_Object* pStreamLen = pRange->GetElementValue(1); | 4732 CPDF_Object* pStreamLen = pRange->GetElementValue(1); |
4733 if (!pStreamLen) | 4733 if (!pStreamLen) |
4734 return -1; | 4734 return -1; |
4735 return pStreamLen->GetInteger(); | 4735 return pStreamLen->GetInteger(); |
4736 } | 4736 } |
OLD | NEW |