From 42a1bc02c0810c039afbcb62170c326f0e717320 Mon Sep 17 00:00:00 2001 From: Wei Li Date: Fri, 12 Feb 2016 18:21:21 -0800 Subject: Fix the way to access marked content. When there is no dictionary for marked content, it potientially may cause crash. But it is not happening now since 1) we now check for the returned dict parameter 2) the alloc function in pdfium does zero initialization. BUG=pdfium:67 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1695633004 . --- core/include/fpdfapi/fpdf_pageobj.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/include/fpdfapi') diff --git a/core/include/fpdfapi/fpdf_pageobj.h b/core/include/fpdfapi/fpdf_pageobj.h index 7a3d390fed..42248c7dd1 100644 --- a/core/include/fpdfapi/fpdf_pageobj.h +++ b/core/include/fpdfapi/fpdf_pageobj.h @@ -265,7 +265,7 @@ class CPDF_GeneralState : public CFX_CountRef { }; class CPDF_ContentMarkItem { public: - typedef enum { None, PropertiesDict, DirectDict, MCID } ParamType; + enum ParamType { None, PropertiesDict, DirectDict }; CPDF_ContentMarkItem(); @@ -277,13 +277,13 @@ class CPDF_ContentMarkItem { inline ParamType GetParamType() const { return m_ParamType; } - inline void* GetParam() const { return m_pParam; } + inline CPDF_Dictionary* GetParam() const { return m_pParam; } inline FX_BOOL HasMCID() const; inline void SetName(const CFX_ByteString& name) { m_MarkName = name; } - inline void SetParam(ParamType type, void* param) { + inline void SetParam(ParamType type, CPDF_Dictionary* param) { m_ParamType = type; m_pParam = param; } @@ -293,7 +293,7 @@ class CPDF_ContentMarkItem { ParamType m_ParamType; - void* m_pParam; + CPDF_Dictionary* m_pParam; }; class CPDF_ContentMarkData { public: -- cgit v1.2.3