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