diff options
author | Lei Zhang <thestig@chromium.org> | 2018-08-13 20:36:16 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-13 20:36:16 +0000 |
commit | d801c9c9caddf3941f6844fab58b19261d7d3cad (patch) | |
tree | 745db126f620e06dadab32fd71ead7bc8ca2dede /core/fxcodec/bmp | |
parent | 30029419ad4b9e5cd382767a8645677afbeff7fd (diff) | |
download | pdfium-d801c9c9caddf3941f6844fab58b19261d7d3cad.tar.xz |
Implement CFX_CodecMemory.
This class is much simpler than CFX_MemoryStream and does only what
CFX_BmpDecompressor and CFX_GifContext needs. Swap out CFX_MemoryStream
and remove CFX_MemoryStream::Seek().
BUG=pdfium:263
Change-Id: Ifd8ce4d2b6c9fedd6ec842d46f54fc8e654fbca7
Reviewed-on: https://pdfium-review.googlesource.com/39880
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@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 | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/fxcodec/bmp/cfx_bmpdecompressor.cpp b/core/fxcodec/bmp/cfx_bmpdecompressor.cpp index c56d17d15d..739853aa13 100644 --- a/core/fxcodec/bmp/cfx_bmpdecompressor.cpp +++ b/core/fxcodec/bmp/cfx_bmpdecompressor.cpp @@ -10,6 +10,7 @@ #include <limits> #include "core/fxcodec/bmp/cfx_bmpcontext.h" +#include "core/fxcrt/fx_safe_types.h" #include "core/fxcrt/fx_system.h" #include "third_party/base/logging.h" #include "third_party/base/numerics/safe_math.h" @@ -659,8 +660,7 @@ void CFX_BmpDecompressor::SaveDecodingStatus(int32_t status) { } void CFX_BmpDecompressor::SetInputBuffer(uint8_t* src_buf, uint32_t src_size) { - input_buffer_ = - pdfium::MakeRetain<CFX_MemoryStream>(src_buf, src_size, false); + input_buffer_ = pdfium::MakeRetain<CFX_CodecMemory>(src_buf, src_size); } 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 2f1585e649..519297881a 100644 --- a/core/fxcodec/bmp/cfx_bmpdecompressor.h +++ b/core/fxcodec/bmp/cfx_bmpdecompressor.h @@ -14,7 +14,7 @@ #include <memory> #include <vector> -#include "core/fxcrt/cfx_memorystream.h" +#include "core/fxcodec/codec/cfx_codec_memory.h" class CFX_BmpContext; @@ -69,7 +69,7 @@ class CFX_BmpDecompressor { bool ValidateFlag() const; void SetHeight(int32_t signed_height); - RetainPtr<CFX_MemoryStream> input_buffer_; + RetainPtr<CFX_CodecMemory> input_buffer_; }; #endif // CORE_FXCODEC_BMP_CFX_BMPDECOMPRESSOR_H_ |