summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/edit/cpdf_creator.cpp3
-rw-r--r--core/fpdfapi/edit/cpdf_encryptor.cpp2
-rw-r--r--core/fpdfapi/edit/cpdf_encryptor.h2
-rw-r--r--core/fpdfapi/edit/cpdf_flateencoder.cpp2
-rw-r--r--core/fpdfapi/edit/cpdf_flateencoder.h2
5 files changed, 6 insertions, 5 deletions
diff --git a/core/fpdfapi/edit/cpdf_creator.cpp b/core/fpdfapi/edit/cpdf_creator.cpp
index 5868c979f2..adf507f844 100644
--- a/core/fpdfapi/edit/cpdf_creator.cpp
+++ b/core/fpdfapi/edit/cpdf_creator.cpp
@@ -224,7 +224,8 @@ bool CPDF_Creator::WriteDirectObj(uint32_t objnum,
break;
}
CPDF_Encryptor encryptor(GetCryptoHandler(), objnum,
- (uint8_t*)str.c_str(), str.GetLength());
+ reinterpret_cast<const uint8_t*>(str.c_str()),
+ str.GetLength());
ByteString content = PDF_EncodeString(
ByteString(encryptor.GetData(), encryptor.GetSize()), bHex);
if (!m_Archive->WriteString(content.AsStringView()))
diff --git a/core/fpdfapi/edit/cpdf_encryptor.cpp b/core/fpdfapi/edit/cpdf_encryptor.cpp
index 858b5b6369..45be9f8447 100644
--- a/core/fpdfapi/edit/cpdf_encryptor.cpp
+++ b/core/fpdfapi/edit/cpdf_encryptor.cpp
@@ -9,7 +9,7 @@
CPDF_Encryptor::CPDF_Encryptor(CPDF_CryptoHandler* pHandler,
int objnum,
- uint8_t* src_data,
+ const uint8_t* src_data,
uint32_t src_size)
: m_pData(nullptr), m_dwSize(0), m_bNewBuf(false) {
if (src_size == 0)
diff --git a/core/fpdfapi/edit/cpdf_encryptor.h b/core/fpdfapi/edit/cpdf_encryptor.h
index 00c9337eb3..1da601d491 100644
--- a/core/fpdfapi/edit/cpdf_encryptor.h
+++ b/core/fpdfapi/edit/cpdf_encryptor.h
@@ -15,7 +15,7 @@ class CPDF_Encryptor {
public:
CPDF_Encryptor(CPDF_CryptoHandler* pHandler,
int objnum,
- uint8_t* src_data,
+ const uint8_t* src_data,
uint32_t src_size);
~CPDF_Encryptor();
diff --git a/core/fpdfapi/edit/cpdf_flateencoder.cpp b/core/fpdfapi/edit/cpdf_flateencoder.cpp
index f68d02c31c..9826932d2a 100644
--- a/core/fpdfapi/edit/cpdf_flateencoder.cpp
+++ b/core/fpdfapi/edit/cpdf_flateencoder.cpp
@@ -29,7 +29,7 @@ CPDF_FlateEncoder::CPDF_FlateEncoder(const CPDF_Stream* pStream,
return;
}
if (bHasFilter || !bFlateEncode) {
- m_pData = const_cast<uint8_t*>(m_pAcc->GetData());
+ m_pData = m_pAcc->GetData();
m_dwSize = m_pAcc->GetSize();
m_pDict = pStream->GetDict();
return;
diff --git a/core/fpdfapi/edit/cpdf_flateencoder.h b/core/fpdfapi/edit/cpdf_flateencoder.h
index acac753e5c..b2213de5f3 100644
--- a/core/fpdfapi/edit/cpdf_flateencoder.h
+++ b/core/fpdfapi/edit/cpdf_flateencoder.h
@@ -23,7 +23,7 @@ class CPDF_FlateEncoder {
void CloneDict();
uint32_t GetSize() const { return m_dwSize; }
- uint8_t* GetData() const { return m_pData.Get(); }
+ const uint8_t* GetData() const { return m_pData.Get(); }
CPDF_Dictionary* GetDict() { return m_pDict.Get(); }