From 5428555d7bca8116fa8c6d6914674f2c2adb17ac Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 9 Oct 2015 13:57:36 -0700 Subject: Merge to XFA: Sanitize CJBig2_SymbolDict's memory usage. - Use std::vector instead of storing pointers to arrays. - Make CJBig2_SymbolDict's members private with accessors. - Use std::vector 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 . --- core/src/fxcodec/jbig2/JBig2_SddProc.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'core/src/fxcodec/jbig2/JBig2_SddProc.h') 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 + #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* gbContext, + std::vector* grContext); CJBig2_SymbolDict* decode_Huffman(CJBig2_BitStream* pStream, - JBig2ArithCtx* gbContext, - JBig2ArithCtx* grContext, + std::vector* gbContext, + std::vector* grContext, IFX_Pause* pPause); public: -- cgit v1.2.3