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

Side by Side Diff: core/fpdfapi/fpdf_parser/cpdf_parser.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, 9 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
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/include/cpdf_parser.h" 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 1003
1004 if (arrIndex.size() == 0) 1004 if (arrIndex.size() == 0)
1005 arrIndex.push_back(std::make_pair(0, size)); 1005 arrIndex.push_back(std::make_pair(0, size));
1006 1006
1007 pArray = pStream->GetDict()->GetArrayBy("W"); 1007 pArray = pStream->GetDict()->GetArrayBy("W");
1008 if (!pArray) { 1008 if (!pArray) {
1009 pStream->Release(); 1009 pStream->Release();
1010 return FALSE; 1010 return FALSE;
1011 } 1011 }
1012 1012
1013 CFX_DWordArray WidthArray; 1013 CFX_ArrayTemplate<FX_DWORD> WidthArray;
1014 FX_SAFE_DWORD dwAccWidth = 0; 1014 FX_SAFE_DWORD dwAccWidth = 0;
1015 for (FX_DWORD i = 0; i < pArray->GetCount(); i++) { 1015 for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
1016 WidthArray.Add(pArray->GetIntegerAt(i)); 1016 WidthArray.Add(pArray->GetIntegerAt(i));
1017 dwAccWidth += WidthArray[i]; 1017 dwAccWidth += WidthArray[i];
1018 } 1018 }
1019 1019
1020 if (!dwAccWidth.IsValid() || WidthArray.GetSize() < 3) { 1020 if (!dwAccWidth.IsValid() || WidthArray.GetSize() < 3) {
1021 pStream->Release(); 1021 pStream->Release();
1022 return FALSE; 1022 return FALSE;
1023 } 1023 }
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
1643 if (!LoadLinearizedAllCrossRefV4(m_LastXRefOffset, m_dwXrefStartObjNum) && 1643 if (!LoadLinearizedAllCrossRefV4(m_LastXRefOffset, m_dwXrefStartObjNum) &&
1644 !LoadLinearizedAllCrossRefV5(m_LastXRefOffset)) { 1644 !LoadLinearizedAllCrossRefV5(m_LastXRefOffset)) {
1645 m_LastXRefOffset = 0; 1645 m_LastXRefOffset = 0;
1646 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; 1646 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum;
1647 return FORMAT_ERROR; 1647 return FORMAT_ERROR;
1648 } 1648 }
1649 1649
1650 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; 1650 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum;
1651 return SUCCESS; 1651 return SUCCESS;
1652 } 1652 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp ('k') | core/fpdfapi/fpdf_parser/include/cpdf_document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698