diff options
author | Nicolas Pena <npm@chromium.org> | 2017-06-22 14:23:52 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-06-22 18:56:36 +0000 |
commit | b32a949d667600cb33e80e1bb8c97a23d96f27d9 (patch) | |
tree | 756bd8fa5190925421a88e699f39889be7903ec6 /core/fxcodec/lbmp/fx_bmp.h | |
parent | 84d8eb9b6fdd2afd43f5970b3544d63aa990d30e (diff) | |
download | pdfium-b32a949d667600cb33e80e1bb8c97a23d96f27d9.tar.xz |
Continue BMP decoder cleanup
This CL replaces raw pointers with vector and unique_ptr. It also fixes
other nits.
Change-Id: I45c99c9aa658681ec3f0b48fc4f407b278b250f5
Reviewed-on: https://pdfium-review.googlesource.com/6830
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcodec/lbmp/fx_bmp.h')
-rw-r--r-- | core/fxcodec/lbmp/fx_bmp.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/core/fxcodec/lbmp/fx_bmp.h b/core/fxcodec/lbmp/fx_bmp.h index e30402070b..175d9bede5 100644 --- a/core/fxcodec/lbmp/fx_bmp.h +++ b/core/fxcodec/lbmp/fx_bmp.h @@ -8,6 +8,8 @@ #define CORE_FXCODEC_LBMP_FX_BMP_H_ #include <setjmp.h> + +#include <memory> #include <vector> #include "core/fxcodec/codec/ccodec_bmpmodule.h" @@ -44,14 +46,14 @@ typedef struct tagBmpFileHeader { uint16_t bfReserved1; uint16_t bfReserved2; uint32_t bfOffBits; -} BmpFileHeader, *BmpFileHeaderPtr; +} BmpFileHeader; typedef struct tagBmpCoreHeader { uint32_t bcSize; uint16_t bcWidth; uint16_t bcHeight; uint16_t bcPlanes; uint16_t bcBitCount; -} BmpCoreHeader, *BmpCoreHeaderPtr; +} BmpCoreHeader; typedef struct tagBmpInfoHeader { uint32_t biSize; int32_t biWidth; @@ -64,7 +66,7 @@ typedef struct tagBmpInfoHeader { int32_t biYPelsPerMeter; uint32_t biClrUsed; uint32_t biClrImportant; -} BmpInfoHeader, *BmpInfoHeaderPtr; +} BmpInfoHeader; #pragma pack() class BMPDecompressor { @@ -83,10 +85,11 @@ class BMPDecompressor { void* context_ptr; - BmpFileHeaderPtr bmp_header_ptr; - BmpInfoHeaderPtr bmp_infoheader_ptr; std::vector<uint8_t> out_row_buffer; + std::vector<uint32_t> palette; + uint8_t* next_in; + uint32_t header_offset; uint32_t width; uint32_t height; uint32_t compress_flag; @@ -98,7 +101,6 @@ class BMPDecompressor { bool imgTB_flag; int32_t pal_num; int32_t pal_type; - uint32_t* pal_ptr; uint32_t data_size; uint32_t img_data_offset; uint32_t img_ifh_size; @@ -110,7 +112,6 @@ class BMPDecompressor { uint32_t mask_green; uint32_t mask_blue; - uint8_t* next_in; uint32_t avail_in; uint32_t skip_size; int32_t decode_status; @@ -125,6 +126,7 @@ class BMPDecompressor { void SaveDecodingStatus(int32_t status); bool ValidateColorIndex(uint8_t val); bool ValidateFlag() const; + void SetHeight(int32_t signed_height); }; class CBmpContext : public CCodec_BmpModule::Context { |