From 83fa467a867c879f75447d99bc99f5f8831026f2 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 30 Oct 2015 11:20:00 -0700 Subject: Fix segv in CFX_BaseArray::~CFX_BaseArray One can't blatantly memset() a class to zero if its parent contains a vtable. Fix some IWYU along the way. Kill some casts along the way. BUG=pdfium:259 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1416943007 . --- xfa/src/fgas/include/fx_mem.h | 3 +++ xfa/src/fgas/include/fx_utl.h | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'xfa/src/fgas/include') diff --git a/xfa/src/fgas/include/fx_mem.h b/xfa/src/fgas/include/fx_mem.h index fe52489c6b..313fc935cc 100644 --- a/xfa/src/fgas/include/fx_mem.h +++ b/xfa/src/fgas/include/fx_mem.h @@ -6,6 +6,9 @@ #ifndef _FX_MEMORY #define _FX_MEMORY + +#include "../../../../core/include/fxcrt/fx_memory.h" // For FX_Alloc(). + class IFX_MEMAllocator; class CFX_Target; enum FX_ALLOCTYPE { diff --git a/xfa/src/fgas/include/fx_utl.h b/xfa/src/fgas/include/fx_utl.h index 86a516b530..e4fcf78aba 100644 --- a/xfa/src/fgas/include/fx_utl.h +++ b/xfa/src/fgas/include/fx_utl.h @@ -6,6 +6,10 @@ #ifndef _FX_UTILS #define _FX_UTILS + +#include "fx_mem.h" +#include "../../../../core/include/fxcrt/fx_coordinates.h" // For CFX_Rect. + class CFX_ThreadLock; class CFX_BaseArray; template @@ -30,6 +34,8 @@ template class CFX_CPLTreeNode; template class CFX_CPLTree; +class FX_BASEARRAYDATA; + class CFX_ThreadLock { public: CFX_ThreadLock(); @@ -43,7 +49,6 @@ class CFX_ThreadLock { class CFX_BaseArray : public CFX_Target { protected: CFX_BaseArray(int32_t iGrowSize, int32_t iBlockSize); - ~CFX_BaseArray(); int32_t GetSize() const; int32_t GetBlockSize() const; uint8_t* AddSpaceTo(int32_t index); @@ -57,7 +62,8 @@ class CFX_BaseArray : public CFX_Target { int32_t iCount = -1); int32_t RemoveLast(int32_t iCount = -1); void RemoveAll(FX_BOOL bLeaveMemory = FALSE); - void* m_pData; + + FX_BASEARRAYDATA* m_pData; }; template class CFX_BaseArrayTemplate : public CFX_BaseArray { -- cgit v1.2.3