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/gif/cfx_gifcontext.cpp | 12 ++---------- core/fxcodec/gif/cfx_gifcontext.h | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) (limited to 'core/fxcodec/gif') diff --git a/core/fxcodec/gif/cfx_gifcontext.cpp b/core/fxcodec/gif/cfx_gifcontext.cpp index f746bc13c5..8f48cfde48 100644 --- a/core/fxcodec/gif/cfx_gifcontext.cpp +++ b/core/fxcodec/gif/cfx_gifcontext.cpp @@ -346,19 +346,11 @@ void CFX_GifContext::SetInputBuffer(pdfium::span src_buf) { input_buffer_ = pdfium::MakeRetain(src_buf); } -uint32_t CFX_GifContext::GetAvailInput(uint8_t** avail_buf) const { +uint32_t CFX_GifContext::GetAvailInput() const { if (!input_buffer_) return 0; - FX_FILESIZE available_size = - input_buffer_->GetSize() - input_buffer_->GetPosition(); - if (avail_buf) { - *avail_buf = nullptr; - if (available_size > 0) - *avail_buf = input_buffer_->GetBuffer() + available_size; - } - - return available_size; + return input_buffer_->GetSize() - input_buffer_->GetPosition(); } bool CFX_GifContext::ReadData(uint8_t* dest, uint32_t size) { diff --git a/core/fxcodec/gif/cfx_gifcontext.h b/core/fxcodec/gif/cfx_gifcontext.h index 90657b05bb..9cc7da9615 100644 --- a/core/fxcodec/gif/cfx_gifcontext.h +++ b/core/fxcodec/gif/cfx_gifcontext.h @@ -42,7 +42,7 @@ class CFX_GifContext : public CCodec_GifModule::Context { CFX_GifDecodeStatus GetFrame(); CFX_GifDecodeStatus LoadFrame(int32_t frame_num); void SetInputBuffer(pdfium::span src_buf); - uint32_t GetAvailInput(uint8_t** avail_buf) const; + uint32_t GetAvailInput() const; size_t GetFrameNum() const { return images_.size(); } UnownedPtr gif_module_; -- cgit v1.2.3