summaryrefslogtreecommitdiff
path: root/core/fxcodec/bmp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-08-31 22:46:37 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-31 22:46:37 +0000
commita38996be8593ba78d3eb31e30d2d6f7c61990ec6 (patch)
treebe978e80632c64f2d7bb46b879092d9d7f28a003 /core/fxcodec/bmp
parentca3a100e7dcf3671bd0774ec3f5233df6996dcea (diff)
downloadpdfium-a38996be8593ba78d3eb31e30d2d6f7c61990ec6.tar.xz
Remove avail_buf out argument from GetAvailInput() methods.chromium/3542chromium/3541chromium/3540chromium/3539
It's always passed as nullptr. It's a good thing, too, since it looks like some of the implementations are returning a wrong pointer. Add some missing |const|s. Change-Id: I768048fdfe4cdd1dc838fee26fec18e024e39920 Reviewed-on: https://pdfium-review.googlesource.com/41810 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.cpp12
-rw-r--r--core/fxcodec/bmp/cfx_bmpdecompressor.h2
2 files changed, 3 insertions, 11 deletions
diff --git a/core/fxcodec/bmp/cfx_bmpdecompressor.cpp b/core/fxcodec/bmp/cfx_bmpdecompressor.cpp
index a25afdf6c9..de97c6d527 100644
--- a/core/fxcodec/bmp/cfx_bmpdecompressor.cpp
+++ b/core/fxcodec/bmp/cfx_bmpdecompressor.cpp
@@ -663,19 +663,11 @@ 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) {
+FX_FILESIZE CFX_BmpDecompressor::GetAvailInput() const {
if (!input_buffer_)
return 0;
- FX_FILESIZE available =
- input_buffer_->GetSize() - input_buffer_->GetPosition();
- if (avail_buf) {
- *avail_buf = nullptr;
- if (available > 0)
- *avail_buf = input_buffer_->GetBuffer() + available;
- }
-
- return available;
+ return input_buffer_->GetSize() - input_buffer_->GetPosition();
}
void CFX_BmpDecompressor::SetHeight(int32_t signed_height) {
diff --git a/core/fxcodec/bmp/cfx_bmpdecompressor.h b/core/fxcodec/bmp/cfx_bmpdecompressor.h
index ed013a2a09..331a6347b4 100644
--- a/core/fxcodec/bmp/cfx_bmpdecompressor.h
+++ b/core/fxcodec/bmp/cfx_bmpdecompressor.h
@@ -28,7 +28,7 @@ class CFX_BmpDecompressor {
int32_t DecodeImage();
int32_t ReadHeader();
void SetInputBuffer(pdfium::span<uint8_t> src_buf);
- FX_FILESIZE GetAvailInput(uint8_t** avail_buf);
+ FX_FILESIZE GetAvailInput() const;
jmp_buf jmpbuf_;
CFX_BmpContext* context_ptr_;