Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp

Issue 1681863002: Fix for-loop which results in no-op (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698