diff options
Diffstat (limited to 'core/fpdfapi/page')
-rw-r--r-- | core/fpdfapi/page/cpdf_image.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp index b10134611c..ec826dc5ed 100644 --- a/core/fpdfapi/page/cpdf_image.cpp +++ b/core/fpdfapi/page/cpdf_image.cpp @@ -200,16 +200,13 @@ void CPDF_Image::SetImage(const RetainPtr<CFX_DIBitmap>& pBitmap) { pCS->AddNew<CPDF_Name>("DeviceRGB"); pCS->AddNew<CPDF_Number>(1); ByteString ct; - { - // Span's lifetime must end before ReleaseBuffer() below. - pdfium::span<char> pBuf = ct.GetBuffer(6); - pBuf[0] = (char)reset_r; - pBuf[1] = (char)reset_g; - pBuf[2] = (char)reset_b; - pBuf[3] = (char)set_r; - pBuf[4] = (char)set_g; - pBuf[5] = (char)set_b; - } + char* pBuf = ct.GetBuffer(6); + pBuf[0] = (char)reset_r; + pBuf[1] = (char)reset_g; + pBuf[2] = (char)reset_b; + pBuf[3] = (char)set_r; + pBuf[4] = (char)set_g; + pBuf[5] = (char)set_b; ct.ReleaseBuffer(6); pCS->AddNew<CPDF_String>(ct, true); } |