summaryrefslogtreecommitdiff
path: root/xfa/src/fgas/include
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-10-30 11:20:00 -0700
committerTom Sepez <tsepez@chromium.org>2015-10-30 11:20:00 -0700
commit83fa467a867c879f75447d99bc99f5f8831026f2 (patch)
tree1da26510f3e805f06862f27d8b4f6bb8ad03ad42 /xfa/src/fgas/include
parent6fc7919796b68d5264030250875dce2358605af1 (diff)
downloadpdfium-83fa467a867c879f75447d99bc99f5f8831026f2.tar.xz
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 .
Diffstat (limited to 'xfa/src/fgas/include')
-rw-r--r--xfa/src/fgas/include/fx_mem.h3
-rw-r--r--xfa/src/fgas/include/fx_utl.h10
2 files changed, 11 insertions, 2 deletions
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 <class baseType>
@@ -30,6 +34,8 @@ template <class baseType>
class CFX_CPLTreeNode;
template <class baseType>
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 baseType>
class CFX_BaseArrayTemplate : public CFX_BaseArray {