From a38996be8593ba78d3eb31e30d2d6f7c61990ec6 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 31 Aug 2018 22:46:37 +0000 Subject: Remove avail_buf out argument from GetAvailInput() methods. 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 Commit-Queue: Tom Sepez --- core/fxcodec/bmp/cfx_bmpdecompressor.cpp | 12 ++---------- core/fxcodec/bmp/cfx_bmpdecompressor.h | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) (limited to 'core/fxcodec/bmp') 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 src_buf) { input_buffer_ = pdfium::MakeRetain(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 src_buf); - FX_FILESIZE GetAvailInput(uint8_t** avail_buf); + FX_FILESIZE GetAvailInput() const; jmp_buf jmpbuf_; CFX_BmpContext* context_ptr_; -- cgit v1.2.3