| 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_edit/editint.h" | 7 #include "core/fpdfapi/fpdf_edit/editint.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1488 m_iStage = 15; | 1488 m_iStage = 15; |
| 1489 } | 1489 } |
| 1490 } | 1490 } |
| 1491 if (m_iStage == 15) { | 1491 if (m_iStage == 15) { |
| 1492 if ((m_dwFlags & FPDFCREATE_NO_ORIGINAL) == 0 && m_Pos) { | 1492 if ((m_dwFlags & FPDFCREATE_NO_ORIGINAL) == 0 && m_Pos) { |
| 1493 IFX_FileRead* pSrcFile = m_pParser->GetFileAccess(); | 1493 IFX_FileRead* pSrcFile = m_pParser->GetFileAccess(); |
| 1494 uint8_t buffer[4096]; | 1494 uint8_t buffer[4096]; |
| 1495 uint32_t src_size = (uint32_t)(uintptr_t)m_Pos; | 1495 uint32_t src_size = (uint32_t)(uintptr_t)m_Pos; |
| 1496 while (src_size) { | 1496 while (src_size) { |
| 1497 uint32_t block_size = src_size > 4096 ? 4096 : src_size; | 1497 uint32_t block_size = src_size > 4096 ? 4096 : src_size; |
| 1498 if (!pSrcFile->ReadBlock(buffer, m_Offset - src_size, block_size)) { | 1498 if (pSrcFile->ReadBlock(buffer, m_Offset - src_size, block_size) != |
| 1499 block_size && |
| 1500 !pSrcFile->IsEOF()) { |
| 1499 return -1; | 1501 return -1; |
| 1500 } | 1502 } |
| 1501 if (m_File.AppendBlock(buffer, block_size) < 0) { | 1503 if (m_File.AppendBlock(buffer, block_size) < 0) { |
| 1502 return -1; | 1504 return -1; |
| 1503 } | 1505 } |
| 1504 src_size -= block_size; | 1506 src_size -= block_size; |
| 1505 if (pPause && pPause->NeedToPauseNow()) { | 1507 if (pPause && pPause->NeedToPauseNow()) { |
| 1506 m_Pos = (void*)(uintptr_t)src_size; | 1508 m_Pos = (void*)(uintptr_t)src_size; |
| 1507 return 1; | 1509 return 1; |
| 1508 } | 1510 } |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2013 m_pCryptoHandler = nullptr; | 2015 m_pCryptoHandler = nullptr; |
| 2014 } | 2016 } |
| 2015 void CPDF_Creator::ResetStandardSecurity() { | 2017 void CPDF_Creator::ResetStandardSecurity() { |
| 2016 if (!m_bLocalCryptoHandler) | 2018 if (!m_bLocalCryptoHandler) |
| 2017 return; | 2019 return; |
| 2018 | 2020 |
| 2019 delete m_pCryptoHandler; | 2021 delete m_pCryptoHandler; |
| 2020 m_pCryptoHandler = nullptr; | 2022 m_pCryptoHandler = nullptr; |
| 2021 m_bLocalCryptoHandler = FALSE; | 2023 m_bLocalCryptoHandler = FALSE; |
| 2022 } | 2024 } |
| OLD | NEW |