diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-08-24 19:45:09 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-24 19:45:09 +0000 |
commit | 16d18d935d055b74e05f615c0325318a329a7fe1 (patch) | |
tree | bce3c35b6db03cedd537a67a28cf91eb0b502b1c /core/fxcodec/bmp | |
parent | 1cb4d6b14cc9375dc04f57d3f2149eccb9e327a8 (diff) | |
download | pdfium-16d18d935d055b74e05f615c0325318a329a7fe1.tar.xz |
Use span<uint8_t> in more fxcodec code.
There are also small tweaks in tests to ensure strict order of
stack variable lifetimes.
Change-Id: Ic9d5c6a2bdd378b517be627f8e29f725bafdc2ad
Reviewed-on: https://pdfium-review.googlesource.com/41310
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcodec/bmp')
-rw-r--r-- | core/fxcodec/bmp/cfx_bmpdecompressor.cpp | 4 | ||||
-rw-r--r-- | core/fxcodec/bmp/cfx_bmpdecompressor.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/core/fxcodec/bmp/cfx_bmpdecompressor.cpp b/core/fxcodec/bmp/cfx_bmpdecompressor.cpp index 383955624c..a25afdf6c9 100644 --- a/core/fxcodec/bmp/cfx_bmpdecompressor.cpp +++ b/core/fxcodec/bmp/cfx_bmpdecompressor.cpp @@ -659,8 +659,8 @@ void CFX_BmpDecompressor::SaveDecodingStatus(int32_t status) { decode_status_ = status; } -void CFX_BmpDecompressor::SetInputBuffer(uint8_t* src_buf, uint32_t src_size) { - input_buffer_ = pdfium::MakeRetain<CFX_CodecMemory>(src_buf, src_size); +void CFX_BmpDecompressor::SetInputBuffer(pdfium::span<uint8_t> src_buf) { + input_buffer_ = pdfium::MakeRetain<CFX_CodecMemory>(src_buf); } FX_FILESIZE CFX_BmpDecompressor::GetAvailInput(uint8_t** avail_buf) { diff --git a/core/fxcodec/bmp/cfx_bmpdecompressor.h b/core/fxcodec/bmp/cfx_bmpdecompressor.h index 519297881a..ed013a2a09 100644 --- a/core/fxcodec/bmp/cfx_bmpdecompressor.h +++ b/core/fxcodec/bmp/cfx_bmpdecompressor.h @@ -15,6 +15,7 @@ #include <vector> #include "core/fxcodec/codec/cfx_codec_memory.h" +#include "third_party/base/span.h" class CFX_BmpContext; @@ -26,7 +27,7 @@ class CFX_BmpDecompressor { void Error(); int32_t DecodeImage(); int32_t ReadHeader(); - void SetInputBuffer(uint8_t* src_buf, uint32_t src_size); + void SetInputBuffer(pdfium::span<uint8_t> src_buf); FX_FILESIZE GetAvailInput(uint8_t** avail_buf); jmp_buf jmpbuf_; |