diff options
author | Lei Zhang <thestig@chromium.org> | 2015-10-09 13:57:36 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-10-09 13:57:36 -0700 |
commit | 5428555d7bca8116fa8c6d6914674f2c2adb17ac (patch) | |
tree | f8217f4229aa6eecc33134a0c8ab9013b20e7fc6 /core/src/fxcodec/jbig2/JBig2_SddProc.h | |
parent | e7bd5081be68feb4978659a0c18090314ff44d09 (diff) | |
download | pdfium-5428555d7bca8116fa8c6d6914674f2c2adb17ac.tar.xz |
Merge to XFA: Sanitize CJBig2_SymbolDict's memory usage.
- Use std::vector<JBig2ArithCtx> instead of storing pointers to arrays.
- Make CJBig2_SymbolDict's members private with accessors.
- Use std::vector<JBig2ArithCtx> in related places.
- Steal Chromium's vector_as_array() and use it as an adaptor as needed.
BUG=514891
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1388203003 .
(cherry picked from commit 3acb1ef909a22368507ed13817c4988c818e3aee)
Review URL: https://codereview.chromium.org/1401533004 .
Diffstat (limited to 'core/src/fxcodec/jbig2/JBig2_SddProc.h')
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_SddProc.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/src/fxcodec/jbig2/JBig2_SddProc.h b/core/src/fxcodec/jbig2/JBig2_SddProc.h index 2c55113dae..01f8014ccc 100644 --- a/core/src/fxcodec/jbig2/JBig2_SddProc.h +++ b/core/src/fxcodec/jbig2/JBig2_SddProc.h @@ -7,25 +7,26 @@ #ifndef CORE_SRC_FXCODEC_JBIG2_JBIG2_SDDPROC_H_ #define CORE_SRC_FXCODEC_JBIG2_JBIG2_SDDPROC_H_ +#include <vector> + #include "../../../include/fxcrt/fx_system.h" +#include "JBig2_ArithDecoder.h" -class CJBig2_ArithDecoder; class CJBig2_BitStream; class CJBig2_HuffmanTable; class CJBig2_Image; class CJBig2_SymbolDict; class IFX_Pause; -struct JBig2ArithCtx; class CJBig2_SDDProc { public: CJBig2_SymbolDict* decode_Arith(CJBig2_ArithDecoder* pArithDecoder, - JBig2ArithCtx* gbContext, - JBig2ArithCtx* grContext); + std::vector<JBig2ArithCtx>* gbContext, + std::vector<JBig2ArithCtx>* grContext); CJBig2_SymbolDict* decode_Huffman(CJBig2_BitStream* pStream, - JBig2ArithCtx* gbContext, - JBig2ArithCtx* grContext, + std::vector<JBig2ArithCtx>* gbContext, + std::vector<JBig2ArithCtx>* grContext, IFX_Pause* pPause); public: |