summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/parser')
-rw-r--r--core/fpdfapi/parser/fpdf_parser_decode.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/fpdfapi/parser/fpdf_parser_decode.cpp b/core/fpdfapi/parser/fpdf_parser_decode.cpp
index 82d84ab705..9ccca121ad 100644
--- a/core/fpdfapi/parser/fpdf_parser_decode.cpp
+++ b/core/fpdfapi/parser/fpdf_parser_decode.cpp
@@ -500,9 +500,8 @@ ByteString PDF_EncodeText(const wchar_t* pString, int len) {
size_t dest_index = 0;
size_t encLen = len * 2 + 2;
{
- pdfium::span<char> cspan = result.GetBuffer(encLen);
- auto dest_buf = pdfium::make_span(reinterpret_cast<uint8_t*>(cspan.data()),
- cspan.size());
+ pdfium::span<uint8_t> dest_buf =
+ pdfium::as_writable_bytes(result.GetBuffer(encLen));
dest_buf[dest_index++] = 0xfe;
dest_buf[dest_index++] = 0xff;
for (int j = 0; j < len; ++j) {