OLD | NEW |
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/fpdfapi/fpdf_page/pageint.h" | 7 #include "core/fpdfapi/fpdf_page/pageint.h" |
8 | 8 |
9 #include <limits.h> | 9 #include <limits.h> |
10 | 10 |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 CPDF_Array* pArray = pDict->GetArrayBy("Functions"); | 769 CPDF_Array* pArray = pDict->GetArrayBy("Functions"); |
770 if (!pArray) { | 770 if (!pArray) { |
771 return FALSE; | 771 return FALSE; |
772 } | 772 } |
773 uint32_t nSubs = pArray->GetCount(); | 773 uint32_t nSubs = pArray->GetCount(); |
774 if (nSubs == 0) { | 774 if (nSubs == 0) { |
775 return FALSE; | 775 return FALSE; |
776 } | 776 } |
777 m_nOutputs = 0; | 777 m_nOutputs = 0; |
778 for (uint32_t i = 0; i < nSubs; i++) { | 778 for (uint32_t i = 0; i < nSubs; i++) { |
779 CPDF_Object* pSub = pArray->GetElementValue(i); | 779 CPDF_Object* pSub = pArray->GetDirectObjectAt(i); |
780 if (pSub == pObj) { | 780 if (pSub == pObj) { |
781 return FALSE; | 781 return FALSE; |
782 } | 782 } |
783 std::unique_ptr<CPDF_Function> pFunc(CPDF_Function::Load(pSub)); | 783 std::unique_ptr<CPDF_Function> pFunc(CPDF_Function::Load(pSub)); |
784 if (!pFunc) { | 784 if (!pFunc) { |
785 return FALSE; | 785 return FALSE; |
786 } | 786 } |
787 // Check that the input dimensionality is 1, and that all output | 787 // Check that the input dimensionality is 1, and that all output |
788 // dimensionalities are the same. | 788 // dimensionalities are the same. |
789 if (pFunc->CountInputs() != kRequiredNumInputs) { | 789 if (pFunc->CountInputs() != kRequiredNumInputs) { |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 for (int i = 0; i < m_nOutputs; i++) { | 933 for (int i = 0; i < m_nOutputs; i++) { |
934 if (results[i] < m_pRanges[i * 2]) { | 934 if (results[i] < m_pRanges[i * 2]) { |
935 results[i] = m_pRanges[i * 2]; | 935 results[i] = m_pRanges[i * 2]; |
936 } else if (results[i] > m_pRanges[i * 2 + 1]) { | 936 } else if (results[i] > m_pRanges[i * 2 + 1]) { |
937 results[i] = m_pRanges[i * 2 + 1]; | 937 results[i] = m_pRanges[i * 2 + 1]; |
938 } | 938 } |
939 } | 939 } |
940 } | 940 } |
941 return TRUE; | 941 return TRUE; |
942 } | 942 } |
OLD | NEW |