diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-04-03 16:32:19 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-03 16:32:19 +0000 |
commit | 232b918d1f0faec230652f4097b834257a7dbb27 (patch) | |
tree | c13213ab3d70cc147a6ea59b0f090a51beecae8f /core/fxcodec | |
parent | 36d7ad4a24287b562e1d88fcde635e36a167bfe3 (diff) | |
download | pdfium-232b918d1f0faec230652f4097b834257a7dbb27.tar.xz |
Re-arrange so inline vectors come last in structs.
This might make the memory tools more effective in finding OOBs.
Change-Id: Id093bb0a88c37954c80d612ac00b5a168e75bdbf
Reviewed-on: https://pdfium-review.googlesource.com/29550
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcodec')
-rw-r--r-- | core/fxcodec/codec/fx_codec_flate.cpp | 6 | ||||
-rw-r--r-- | core/fxcodec/gif/cfx_lzwdecompressor.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/fxcodec/codec/fx_codec_flate.cpp b/core/fxcodec/codec/fx_codec_flate.cpp index e33a3d4810..8cef6c7125 100644 --- a/core/fxcodec/codec/fx_codec_flate.cpp +++ b/core/fxcodec/codec/fx_codec_flate.cpp @@ -40,7 +40,7 @@ static void my_free_func(void* opaque, void* address) { namespace { -constexpr const static uint32_t kMaxTotalOutSize = 1024 * 1024 * 1024; // 1 GiB +static constexpr uint32_t kMaxTotalOutSize = 1024 * 1024 * 1024; // 1 GiB uint32_t FlateGetPossiblyTruncatedTotalOut(void* context) { return std::min(pdfium::base::saturated_cast<uint32_t>( @@ -121,11 +121,11 @@ class CLZWDecoder { uint8_t* m_pOutput; const uint8_t* m_pInput; bool m_Early; - uint32_t m_CodeArray[5021]; uint32_t m_nCodes; - uint8_t m_DecodeStack[4000]; uint32_t m_StackLen; int m_CodeLen; + uint32_t m_CodeArray[5021]; + uint8_t m_DecodeStack[4000]; }; void CLZWDecoder::AddCode(uint32_t prefix_code, uint8_t append_char) { diff --git a/core/fxcodec/gif/cfx_lzwdecompressor.h b/core/fxcodec/gif/cfx_lzwdecompressor.h index e6e0634b10..808f50a7cf 100644 --- a/core/fxcodec/gif/cfx_lzwdecompressor.h +++ b/core/fxcodec/gif/cfx_lzwdecompressor.h @@ -54,12 +54,12 @@ class CFX_LZWDecompressor { uint8_t code_first_; std::vector<uint8_t> decompressed_; size_t decompressed_next_; - CodeEntry code_table_[GIF_MAX_LZW_CODE]; uint16_t code_old_; uint8_t* next_in_; uint32_t avail_in_; uint8_t bits_left_; uint32_t code_store_; + CodeEntry code_table_[GIF_MAX_LZW_CODE]; }; #endif // CORE_FXCODEC_GIF_CFX_LZWDECOMPRESSOR_H_ |