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

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

Issue 1679783002: Fix for-loop which results in no-op (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@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 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
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