diff options
author | Ryan Harrison <rharrison@chromium.org> | 2018-02-12 20:43:53 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-12 20:43:53 +0000 |
commit | ad905158b86269686f94ea76d1b700f68ea377d5 (patch) | |
tree | 5593de93f448108c9b8122593db2c08e683c6b51 /core/fxcrt/cfx_memorystream.cpp | |
parent | 30b41e49a128d861f23ed24ca91bbde0d66a64c7 (diff) | |
download | pdfium-ad905158b86269686f94ea76d1b700f68ea377d5.tar.xz |
Convert CFX_BmpDecompressor to use CFX_MemoryStream
This also adds a Seek method to CFX_MemoryStream
BUG=pdfium:1007
Change-Id: I2c7e1d3b6d8aff36e302014cb2e8ffc0f23ef7c4
Reviewed-on: https://pdfium-review.googlesource.com/26230
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcrt/cfx_memorystream.cpp')
-rw-r--r-- | core/fxcrt/cfx_memorystream.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/fxcrt/cfx_memorystream.cpp b/core/fxcrt/cfx_memorystream.cpp index 345b381226..dcd21f073f 100644 --- a/core/fxcrt/cfx_memorystream.cpp +++ b/core/fxcrt/cfx_memorystream.cpp @@ -148,6 +148,14 @@ bool CFX_MemoryStream::WriteBlock(const void* buffer, return true; } +bool CFX_MemoryStream::Seek(size_t pos) { + if (pos > m_nCurSize) + return false; + + m_nCurPos = pos; + return true; +} + void CFX_MemoryStream::EstimateSize(size_t nInitSize, size_t nGrowSize) { if (m_dwFlags & Type::kConsecutive) { if (m_Blocks.empty()) { |