From 3e838a75ae5c0bb0e524f745df69e54a021fc5ec Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 9 Oct 2018 19:44:11 +0000 Subject: Pass CFX_CodecMemory in place of spans to codecs. Next step towards making CFX_CodecMemory own the memory it is ref-counting. Change-Id: I5922d80d13032c3ea028447c47d34a10234109a3 Reviewed-on: https://pdfium-review.googlesource.com/c/43630 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- core/fxcodec/bmp/cfx_bmpdecompressor.cpp | 6 ++++-- core/fxcodec/bmp/cfx_bmpdecompressor.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'core/fxcodec/bmp') diff --git a/core/fxcodec/bmp/cfx_bmpdecompressor.cpp b/core/fxcodec/bmp/cfx_bmpdecompressor.cpp index de97c6d527..35b76f2343 100644 --- a/core/fxcodec/bmp/cfx_bmpdecompressor.cpp +++ b/core/fxcodec/bmp/cfx_bmpdecompressor.cpp @@ -8,6 +8,7 @@ #include #include +#include #include "core/fxcodec/bmp/cfx_bmpcontext.h" #include "core/fxcrt/fx_safe_types.h" @@ -659,8 +660,9 @@ void CFX_BmpDecompressor::SaveDecodingStatus(int32_t status) { decode_status_ = status; } -void CFX_BmpDecompressor::SetInputBuffer(pdfium::span src_buf) { - input_buffer_ = pdfium::MakeRetain(src_buf); +void CFX_BmpDecompressor::SetInputBuffer( + RetainPtr codec_memory) { + input_buffer_ = std::move(codec_memory); } FX_FILESIZE CFX_BmpDecompressor::GetAvailInput() const { diff --git a/core/fxcodec/bmp/cfx_bmpdecompressor.h b/core/fxcodec/bmp/cfx_bmpdecompressor.h index beaf9bf78a..53d52ae14c 100644 --- a/core/fxcodec/bmp/cfx_bmpdecompressor.h +++ b/core/fxcodec/bmp/cfx_bmpdecompressor.h @@ -25,7 +25,7 @@ class CFX_BmpDecompressor { void Error(); int32_t DecodeImage(); int32_t ReadHeader(); - void SetInputBuffer(pdfium::span src_buf); + void SetInputBuffer(RetainPtr codec_memory); FX_FILESIZE GetAvailInput() const; jmp_buf jmpbuf_; -- cgit v1.2.3