summaryrefslogtreecommitdiff
path: root/core/fxcodec/gif/cfx_lzwdecompressor.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcodec/gif/cfx_lzwdecompressor.h')
-rw-r--r--core/fxcodec/gif/cfx_lzwdecompressor.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/core/fxcodec/gif/cfx_lzwdecompressor.h b/core/fxcodec/gif/cfx_lzwdecompressor.h
index 10c0a566d7..717c055973 100644
--- a/core/fxcodec/gif/cfx_lzwdecompressor.h
+++ b/core/fxcodec/gif/cfx_lzwdecompressor.h
@@ -29,11 +29,21 @@ class CFX_LZWDecompressor {
uint8_t* des_buf,
uint32_t* des_size);
+ // Used by unittests, should not be called in production code.
+ uint32_t ExtractDataForTest(uint8_t* des_buf, uint32_t des_size) {
+ return ExtractData(des_buf, des_size);
+ }
+
+ std::vector<uint8_t>* DecompressedForTest() { return &decompressed_; }
+
+ size_t* DecompressedNextForTest() { return &decompressed_next_; }
+
private:
CFX_LZWDecompressor(uint8_t color_exp, uint8_t code_exp);
void ClearTable();
void AddCode(uint16_t prefix_code, uint8_t append_char);
bool DecodeString(uint16_t code);
+ uint32_t ExtractData(uint8_t* des_buf, uint32_t des_size);
uint8_t code_size_;
uint8_t code_size_cur_;
@@ -42,8 +52,8 @@ class CFX_LZWDecompressor {
uint16_t code_end_;
uint16_t code_next_;
uint8_t code_first_;
- uint8_t stack_[GIF_MAX_LZW_CODE];
- size_t stack_size_;
+ std::vector<uint8_t> decompressed_;
+ size_t decompressed_next_;
CodeEntry code_table_[GIF_MAX_LZW_CODE];
uint16_t code_old_;
uint8_t* next_in_;