summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/jbig2/JBig2_SddProc.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-10-09 13:51:05 -0700
committerLei Zhang <thestig@chromium.org>2015-10-09 13:51:05 -0700
commit3acb1ef909a22368507ed13817c4988c818e3aee (patch)
treec5fcef7a3f30562c2bfc6118c818eb120211687c /core/src/fxcodec/jbig2/JBig2_SddProc.h
parentfd751f28cecce61ab36038799043639d570e0b26 (diff)
downloadpdfium-chromium/2533.tar.xz
Sanitize CJBig2_SymbolDict's memory usage.chromium/2534chromium/2533chromium/2532
- 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 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1388203003 .
Diffstat (limited to 'core/src/fxcodec/jbig2/JBig2_SddProc.h')
-rw-r--r--core/src/fxcodec/jbig2/JBig2_SddProc.h13
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: