| 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 "../../../include/fpdfapi/fpdf_parser.h" | 7 #include "../../../include/fpdfapi/fpdf_parser.h" |
| 8 #include "../../../include/fpdfapi/fpdf_module.h" | 8 #include "../../../include/fpdfapi/fpdf_module.h" |
| 9 #include "../../../include/fpdfapi/fpdf_page.h" | 9 #include "../../../include/fpdfapi/fpdf_page.h" |
| 10 #include "../../../../third_party/numerics/safe_math.h" | 10 #include "../../../../third_party/numerics/safe_math.h" |
| (...skipping 3971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3982 pPage->Release(); | 3982 pPage->Release(); |
| 3983 m_docStatus = PDF_DATAAVAIL_ERROR; | 3983 m_docStatus = PDF_DATAAVAIL_ERROR; |
| 3984 return FALSE; | 3984 return FALSE; |
| 3985 } | 3985 } |
| 3986 pPage->Release(); | 3986 pPage->Release(); |
| 3987 return TRUE; | 3987 return TRUE; |
| 3988 } | 3988 } |
| 3989 FX_BOOL CPDF_DataAvail::CheckPageNode(CPDF_PageNode &pageNodes, FX_INT32 iPage,
FX_INT32 &iCount, IFX_DownloadHints* pHints) | 3989 FX_BOOL CPDF_DataAvail::CheckPageNode(CPDF_PageNode &pageNodes, FX_INT32 iPage,
FX_INT32 &iCount, IFX_DownloadHints* pHints) |
| 3990 { | 3990 { |
| 3991 FX_INT32 iSize = pageNodes.m_childNode.GetSize(); | 3991 FX_INT32 iSize = pageNodes.m_childNode.GetSize(); |
| 3992 if (!iSize) { | 3992 if (iSize <= 0 || iPage >= iSize) { |
| 3993 m_docStatus = PDF_DATAAVAIL_ERROR; | 3993 m_docStatus = PDF_DATAAVAIL_ERROR; |
| 3994 return FALSE; | 3994 return FALSE; |
| 3995 } | 3995 } |
| 3996 for (FX_INT32 i = 0; i < iSize; ++i) { | 3996 for (FX_INT32 i = 0; i < iSize; ++i) { |
| 3997 CPDF_PageNode *pNode = (CPDF_PageNode*)pageNodes.m_childNode.GetAt(i); | 3997 CPDF_PageNode *pNode = (CPDF_PageNode*)pageNodes.m_childNode.GetAt(i); |
| 3998 if (!pNode) { | 3998 if (!pNode) { |
| 3999 continue; | 3999 continue; |
| 4000 } | 4000 } |
| 4001 switch (pNode->m_type) { | 4001 switch (pNode->m_type) { |
| 4002 case PDF_PAGENODE_UNKOWN: | 4002 case PDF_PAGENODE_UNKOWN: |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4405 { | 4405 { |
| 4406 FX_INT32 iSize = m_childNode.GetSize(); | 4406 FX_INT32 iSize = m_childNode.GetSize(); |
| 4407 for (FX_INT32 i = 0; i < iSize; ++i) { | 4407 for (FX_INT32 i = 0; i < iSize; ++i) { |
| 4408 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; | 4408 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; |
| 4409 if (pNode) { | 4409 if (pNode) { |
| 4410 delete pNode; | 4410 delete pNode; |
| 4411 } | 4411 } |
| 4412 } | 4412 } |
| 4413 m_childNode.RemoveAll(); | 4413 m_childNode.RemoveAll(); |
| 4414 } | 4414 } |
| OLD | NEW |