diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2011-01-02 13:05:22 +0300 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2011-01-02 13:05:22 +0300 |
commit | 6127bcf854cd81ef0d14efb1a88b231da33a9d93 (patch) | |
tree | 274c6a411f03642e306025d47d368152998de3e8 /source/gameengine/VideoTexture/ImageBase.cpp | |
parent | f101e59e09e93ea6f986f876a096127264a39f12 (diff) |
CXX_Guardedalloc was complaining about freeing NULL pointers in VideoTexture. I've added guards around the deletes to prevent this.
Diffstat (limited to 'source/gameengine/VideoTexture/ImageBase.cpp')
-rw-r--r-- | source/gameengine/VideoTexture/ImageBase.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/gameengine/VideoTexture/ImageBase.cpp b/source/gameengine/VideoTexture/ImageBase.cpp index 88a20fadcf7..bbeebfb590f 100644 --- a/source/gameengine/VideoTexture/ImageBase.cpp +++ b/source/gameengine/VideoTexture/ImageBase.cpp @@ -56,7 +56,8 @@ m_staticSources(staticSrc), m_pyfilter(NULL) ImageBase::~ImageBase (void) { // release image - delete [] m_image; + if (m_image) + delete [] m_image; } @@ -198,7 +199,8 @@ void ImageBase::init (short width, short height) // set new buffer size m_imgSize = newSize; // release previous and create new buffer - delete [] m_image; + if (m_image) + delete [] m_image; m_image = new unsigned int[m_imgSize]; } // new image size |