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 <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 2419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2430 PARSE_CONTEXT* pContext, | 2430 PARSE_CONTEXT* pContext, |
2431 FX_DWORD objnum, | 2431 FX_DWORD objnum, |
2432 FX_DWORD gennum) { | 2432 FX_DWORD gennum) { |
2433 CPDF_Object* pLenObj = pDict->GetElement(FX_BSTRC("Length")); | 2433 CPDF_Object* pLenObj = pDict->GetElement(FX_BSTRC("Length")); |
2434 FX_FILESIZE len = -1; | 2434 FX_FILESIZE len = -1; |
2435 if (pLenObj && ((pLenObj->GetType() != PDFOBJ_REFERENCE) || | 2435 if (pLenObj && ((pLenObj->GetType() != PDFOBJ_REFERENCE) || |
2436 ((((CPDF_Reference*)pLenObj)->GetObjList()) && | 2436 ((((CPDF_Reference*)pLenObj)->GetObjList()) && |
2437 ((CPDF_Reference*)pLenObj)->GetRefObjNum() != objnum))) { | 2437 ((CPDF_Reference*)pLenObj)->GetRefObjNum() != objnum))) { |
2438 len = pLenObj->GetInteger(); | 2438 len = pLenObj->GetInteger(); |
2439 } | 2439 } |
2440 // Check whether end of line markers follow the keyword 'stream'. | 2440 // Locate the start of stream. |
2441 // The stream starts after end of line markers. | 2441 ToNextLine(); |
2442 m_Pos += ReadEOLMarkers(m_Pos); | |
2443 FX_FILESIZE streamStartPos = m_Pos; | 2442 FX_FILESIZE streamStartPos = m_Pos; |
2444 if (pContext) { | 2443 if (pContext) { |
2445 pContext->m_DataStart = streamStartPos; | 2444 pContext->m_DataStart = streamStartPos; |
2446 } | 2445 } |
2447 const unsigned int ENDSTREAM_LEN = sizeof("endstream") - 1; | 2446 const unsigned int ENDSTREAM_LEN = sizeof("endstream") - 1; |
2448 const unsigned int ENDOBJ_LEN = sizeof("endobj") - 1; | 2447 const unsigned int ENDOBJ_LEN = sizeof("endobj") - 1; |
2449 CPDF_CryptoHandler* pCryptoHandler = | 2448 CPDF_CryptoHandler* pCryptoHandler = |
2450 objnum == (FX_DWORD)m_MetadataObjnum ? nullptr : m_pCryptoHandler; | 2449 objnum == (FX_DWORD)m_MetadataObjnum ? nullptr : m_pCryptoHandler; |
2451 if (!pCryptoHandler) { | 2450 if (!pCryptoHandler) { |
2452 FX_BOOL bSearchForKeyword = TRUE; | 2451 FX_BOOL bSearchForKeyword = TRUE; |
(...skipping 2196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4649 return FALSE; | 4648 return FALSE; |
4650 } | 4649 } |
4651 CPDF_PageNode::~CPDF_PageNode() { | 4650 CPDF_PageNode::~CPDF_PageNode() { |
4652 int32_t iSize = m_childNode.GetSize(); | 4651 int32_t iSize = m_childNode.GetSize(); |
4653 for (int32_t i = 0; i < iSize; ++i) { | 4652 for (int32_t i = 0; i < iSize; ++i) { |
4654 CPDF_PageNode* pNode = (CPDF_PageNode*)m_childNode[i]; | 4653 CPDF_PageNode* pNode = (CPDF_PageNode*)m_childNode[i]; |
4655 delete pNode; | 4654 delete pNode; |
4656 } | 4655 } |
4657 m_childNode.RemoveAll(); | 4656 m_childNode.RemoveAll(); |
4658 } | 4657 } |
OLD | NEW |