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

Side by Side Diff: core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp

Issue 1832113003: Replace CFX_DWordArray with CFX_ArrayTemplate<FX_DWORD>. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Re-upload Created 4 years, 8 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 | « core/fpdfapi/fpdf_parser/cpdf_hint_tables.h ('k') | core/fpdfapi/fpdf_parser/cpdf_parser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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/fpdfapi/fpdf_parser/cpdf_hint_tables.h" 7 #include "core/fpdfapi/fpdf_parser/cpdf_hint_tables.h"
8 8
9 #include "core/fpdfapi/fpdf_parser/cpdf_data_avail.h" 9 #include "core/fpdfapi/fpdf_parser/cpdf_data_avail.h"
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 return FALSE; 119 return FALSE;
120 m_dwDeltaNObjsArray.Add(safeDeltaObj.ValueOrDie()); 120 m_dwDeltaNObjsArray.Add(safeDeltaObj.ValueOrDie());
121 } 121 }
122 hStream->ByteAlign(); 122 hStream->ByteAlign();
123 123
124 required_bits = dwDeltaPageLenBits; 124 required_bits = dwDeltaPageLenBits;
125 required_bits *= pdfium::base::checked_cast<FX_DWORD>(nPages); 125 required_bits *= pdfium::base::checked_cast<FX_DWORD>(nPages);
126 if (!CanReadFromBitStream(hStream, required_bits)) 126 if (!CanReadFromBitStream(hStream, required_bits))
127 return FALSE; 127 return FALSE;
128 128
129 CFX_DWordArray dwPageLenArray; 129 CFX_ArrayTemplate<FX_DWORD> dwPageLenArray;
130 for (int i = 0; i < nPages; ++i) { 130 for (int i = 0; i < nPages; ++i) {
131 FX_SAFE_DWORD safePageLen = hStream->GetBits(dwDeltaPageLenBits); 131 FX_SAFE_DWORD safePageLen = hStream->GetBits(dwDeltaPageLenBits);
132 safePageLen += dwPageLeastLen; 132 safePageLen += dwPageLeastLen;
133 if (!safePageLen.IsValid()) 133 if (!safePageLen.IsValid())
134 return FALSE; 134 return FALSE;
135 dwPageLenArray.Add(safePageLen.ValueOrDie()); 135 dwPageLenArray.Add(safePageLen.ValueOrDie());
136 } 136 }
137 137
138 CPDF_Object* pOffsetE = m_pLinearizedDict->GetElementValue("E"); 138 CPDF_Object* pOffsetE = m_pLinearizedDict->GetElementValue("E");
139 int nOffsetE = pOffsetE ? pOffsetE->GetInteger() : -1; 139 int nOffsetE = pOffsetE ? pOffsetE->GetInteger() : -1;
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 CPDF_Array* pRange = m_pLinearizedDict->GetArrayBy("H"); 461 CPDF_Array* pRange = m_pLinearizedDict->GetArrayBy("H");
462 if (!pRange) 462 if (!pRange)
463 return -1; 463 return -1;
464 464
465 CPDF_Object* pStreamLen = pRange->GetElementValue(1); 465 CPDF_Object* pStreamLen = pRange->GetElementValue(1);
466 if (!pStreamLen) 466 if (!pStreamLen)
467 return -1; 467 return -1;
468 468
469 return pStreamLen->GetInteger(); 469 return pStreamLen->GetInteger();
470 } 470 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_hint_tables.h ('k') | core/fpdfapi/fpdf_parser/cpdf_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698