diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-21 19:56:50 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-21 19:56:50 +0400 |
commit | 64fe7139ec10531972ceec7137eaa7fdec7cfef7 (patch) | |
tree | 2f1ea4084765cb209e12f5d8ac6c351441be7079 /source/gameengine/Ketsji/KX_PolygonMaterial.h | |
parent | b56aabf815dd60827da81574501ea1d12ce3a38b (diff) |
fix [#31045]
the blender game engine could reference a freed texface or mcolor array.
Diffstat (limited to 'source/gameengine/Ketsji/KX_PolygonMaterial.h')
-rw-r--r-- | source/gameengine/Ketsji/KX_PolygonMaterial.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h index 1af8a72c1fd..f7ad3973212 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.h +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h @@ -37,6 +37,7 @@ #include "RAS_MaterialBucket.h" #include "RAS_IRasterizer.h" #include "DNA_ID.h" +#include "DNA_meshdata_types.h" #ifdef WITH_CXX_GUARDEDALLOC #include "MEM_guardedalloc.h" @@ -58,9 +59,9 @@ class KX_PolygonMaterial : public PyObjectPlus, public RAS_IPolyMaterial Py_Header private: /** Blender texture face structure. */ - MTFace* m_tface; - unsigned int* m_mcol; - Material* m_material; + mutable MTFace m_tface; + mutable unsigned int m_mcol; + Material* m_material; #ifdef WITH_PYTHON PyObject* m_pymaterial; @@ -119,12 +120,12 @@ public: */ MTFace* GetMTFace(void) const { - return m_tface; + return &m_tface; } unsigned int* GetMCol(void) const { - return m_mcol; + return &m_mcol; } virtual void GetMaterialRGBAColor(unsigned char *rgba) const; |