summaryrefslogtreecommitdiff
path: root/core/fxcodec/bmp/cfx_bmpdecompressor.h
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-02-12 20:43:53 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-12 20:43:53 +0000
commitad905158b86269686f94ea76d1b700f68ea377d5 (patch)
tree5593de93f448108c9b8122593db2c08e683c6b51 /core/fxcodec/bmp/cfx_bmpdecompressor.h
parent30b41e49a128d861f23ed24ca91bbde0d66a64c7 (diff)
downloadpdfium-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/fxcodec/bmp/cfx_bmpdecompressor.h')
-rw-r--r--core/fxcodec/bmp/cfx_bmpdecompressor.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/fxcodec/bmp/cfx_bmpdecompressor.h b/core/fxcodec/bmp/cfx_bmpdecompressor.h
index 499d559637..eece78c7ca 100644
--- a/core/fxcodec/bmp/cfx_bmpdecompressor.h
+++ b/core/fxcodec/bmp/cfx_bmpdecompressor.h
@@ -14,6 +14,8 @@
#include <memory>
#include <vector>
+#include "core/fxcrt/cfx_memorystream.h"
+
class CFX_BmpDecompressor {
public:
CFX_BmpDecompressor();
@@ -31,7 +33,6 @@ class CFX_BmpDecompressor {
std::vector<uint8_t> out_row_buffer_;
std::vector<uint32_t> palette_;
- uint8_t* next_in_;
uint32_t header_offset_;
uint32_t width_;
@@ -56,8 +57,6 @@ class CFX_BmpDecompressor {
uint32_t mask_green_;
uint32_t mask_blue_;
- uint32_t avail_in_;
- uint32_t skip_size_;
int32_t decode_status_;
private:
@@ -66,11 +65,13 @@ class CFX_BmpDecompressor {
int32_t DecodeRGB();
int32_t DecodeRLE8();
int32_t DecodeRLE4();
- uint8_t* ReadData(uint8_t** des_buf, uint32_t data_size);
+ bool ReadData(uint8_t* destination, uint32_t size);
void SaveDecodingStatus(int32_t status);
bool ValidateColorIndex(uint8_t val);
bool ValidateFlag() const;
void SetHeight(int32_t signed_height);
+
+ RetainPtr<CFX_MemoryStream> input_buffer_;
};
#endif // CORE_FXCODEC_BMP_CFX_BMPDECOMPRESSOR_H_