diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-04-18 19:44:30 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-18 19:44:30 +0000 |
commit | 24582d2c000f11ed4bfcb2579b79d10afc809062 (patch) | |
tree | f29ca1621ea70b9ea92d2f78b31c85b55a58a485 /core/fpdfapi/page/cpdf_image.cpp | |
parent | 9e625db795ca7e112d692bda7200b69a873d75f7 (diff) | |
download | pdfium-24582d2c000f11ed4bfcb2579b79d10afc809062.tar.xz |
Revert "Return pdfium::span<char> from ByteString::GetBuffer()."
This reverts commit 80a6cbe0a427e155de8555bc867af745d10f9777.
Reason for revert: too many abrts in beta branch.
TBR: dsinclair@chromium.org
Bug: 832557, 832978, 832992, 833062, 833097
Change-Id: I7d511dbb224ddc644be96ea2f3770ad6f73debf5
Reviewed-on: https://pdfium-review.googlesource.com/30792
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
(cherry picked from commit 3d523e3cf89440e2ffc6571b1c687ad5e3f0318f)
Reviewed-on: https://pdfium-review.googlesource.com/30950
Diffstat (limited to 'core/fpdfapi/page/cpdf_image.cpp')
-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); } |