| 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 "../../../src/fxcrt/fx_safe_types.h" | 10 #include "../../../src/fxcrt/fx_safe_types.h" |
| (...skipping 2463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2474 m_Pos = StreamStartPos; | 2474 m_Pos = StreamStartPos; |
| 2475 if (FindTag(FX_BSTRC("endobj"), 0) < 0) { | 2475 if (FindTag(FX_BSTRC("endobj"), 0) < 0) { |
| 2476 return NULL; | 2476 return NULL; |
| 2477 } | 2477 } |
| 2478 } | 2478 } |
| 2479 } | 2479 } |
| 2480 m_Pos = StreamStartPos; | 2480 m_Pos = StreamStartPos; |
| 2481 } | 2481 } |
| 2482 CPDF_Stream* pStream; | 2482 CPDF_Stream* pStream; |
| 2483 FX_LPBYTE pData = FX_Alloc(FX_BYTE, len); | 2483 FX_LPBYTE pData = FX_Alloc(FX_BYTE, len); |
| 2484 if (!pData) { | |
| 2485 return NULL; | |
| 2486 } | |
| 2487 ReadBlock(pData, len); | 2484 ReadBlock(pData, len); |
| 2488 if (pCryptoHandler) { | 2485 if (pCryptoHandler) { |
| 2489 CFX_BinaryBuf dest_buf; | 2486 CFX_BinaryBuf dest_buf; |
| 2490 dest_buf.EstimateSize(pCryptoHandler->DecryptGetSize(len)); | 2487 dest_buf.EstimateSize(pCryptoHandler->DecryptGetSize(len)); |
| 2491 FX_LPVOID context = pCryptoHandler->DecryptStart(objnum, gennum); | 2488 FX_LPVOID context = pCryptoHandler->DecryptStart(objnum, gennum); |
| 2492 pCryptoHandler->DecryptStream(context, pData, len, dest_buf); | 2489 pCryptoHandler->DecryptStream(context, pData, len, dest_buf); |
| 2493 pCryptoHandler->DecryptFinish(context, dest_buf); | 2490 pCryptoHandler->DecryptFinish(context, dest_buf); |
| 2494 FX_Free(pData); | 2491 FX_Free(pData); |
| 2495 pData = dest_buf.GetBuffer(); | 2492 pData = dest_buf.GetBuffer(); |
| 2496 len = dest_buf.GetSize(); | 2493 len = dest_buf.GetSize(); |
| (...skipping 2149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4646 { | 4643 { |
| 4647 FX_INT32 iSize = m_childNode.GetSize(); | 4644 FX_INT32 iSize = m_childNode.GetSize(); |
| 4648 for (FX_INT32 i = 0; i < iSize; ++i) { | 4645 for (FX_INT32 i = 0; i < iSize; ++i) { |
| 4649 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; | 4646 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; |
| 4650 if (pNode) { | 4647 if (pNode) { |
| 4651 delete pNode; | 4648 delete pNode; |
| 4652 } | 4649 } |
| 4653 } | 4650 } |
| 4654 m_childNode.RemoveAll(); | 4651 m_childNode.RemoveAll(); |
| 4655 } | 4652 } |
| OLD | NEW |