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

Side by Side Diff: core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp

Issue 372473003: Remove custom memory manager (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Change malloc to calloc Created 6 years, 5 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 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 "../../../include/fpdfapi/fpdf_page.h" 7 #include "../../../include/fpdfapi/fpdf_page.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 8 #include "../../../include/fpdfapi/fpdf_module.h"
9 #include "pageint.h" 9 #include "pageint.h"
10 #include <limits.h> 10 #include <limits.h>
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 } 714 }
715 CPDF_Array* pArray = pDict->GetArray(FX_BSTRC("Functions")); 715 CPDF_Array* pArray = pDict->GetArray(FX_BSTRC("Functions"));
716 if (pArray == NULL) { 716 if (pArray == NULL) {
717 return FALSE; 717 return FALSE;
718 } 718 }
719 m_nSubs = pArray->GetCount(); 719 m_nSubs = pArray->GetCount();
720 if (m_nSubs == 0) { 720 if (m_nSubs == 0) {
721 return FALSE; 721 return FALSE;
722 } 722 }
723 m_pSubFunctions = FX_Alloc(CPDF_Function*, m_nSubs); 723 m_pSubFunctions = FX_Alloc(CPDF_Function*, m_nSubs);
724 FXSYS_memset32(m_pSubFunctions, 0, sizeof(CPDF_Function*)*m_nSubs);
725 m_nOutputs = 0; 724 m_nOutputs = 0;
726 int i; 725 int i;
727 for (i = 0; i < m_nSubs; i ++) { 726 for (i = 0; i < m_nSubs; i ++) {
728 CPDF_Object* pSub = pArray->GetElementValue(i); 727 CPDF_Object* pSub = pArray->GetElementValue(i);
729 if (pSub == pObj) { 728 if (pSub == pObj) {
730 return FALSE; 729 return FALSE;
731 } 730 }
732 m_pSubFunctions[i] = CPDF_Function::Load(pSub); 731 m_pSubFunctions[i] = CPDF_Function::Load(pSub);
733 if (m_pSubFunctions[i] == NULL) { 732 if (m_pSubFunctions[i] == NULL) {
734 return FALSE; 733 return FALSE;
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 for (int i = 0; i < m_nOutputs; i ++) { 876 for (int i = 0; i < m_nOutputs; i ++) {
878 if (results[i] < m_pRanges[i * 2]) { 877 if (results[i] < m_pRanges[i * 2]) {
879 results[i] = m_pRanges[i * 2]; 878 results[i] = m_pRanges[i * 2];
880 } else if (results[i] > m_pRanges[i * 2 + 1]) { 879 } else if (results[i] > m_pRanges[i * 2 + 1]) {
881 results[i] = m_pRanges[i * 2 + 1]; 880 results[i] = m_pRanges[i * 2 + 1];
882 } 881 }
883 } 882 }
884 } 883 }
885 return TRUE; 884 return TRUE;
886 } 885 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698