From b4354df6fbcc233592d093ad2a068cada0f07c41 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 20 Nov 2014 09:41:27 +0000 Subject: [PATCH] Fixed segfalt in Texture2DArray copy constructor where it would apply images to an uninitialzed vector. git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14498 16af8721-9629-0410-8352-f15c8da7e697 --- src/osg/Texture2DArray.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/osg/Texture2DArray.cpp b/src/osg/Texture2DArray.cpp index 9fb51e31c..20597738e 100644 --- a/src/osg/Texture2DArray.cpp +++ b/src/osg/Texture2DArray.cpp @@ -32,15 +32,16 @@ Texture2DArray::Texture2DArray(const Texture2DArray& text,const CopyOp& copyop): Texture(text,copyop), _textureWidth(text._textureWidth), _textureHeight(text._textureHeight), - _textureDepth(text._textureDepth), + _textureDepth(0), _numMipmapLevels(text._numMipmapLevels), _subloadCallback(text._subloadCallback) { + setTextureDepth(text._textureDepth); + // copy all images by iterating through all of them for (int i=0; i < text._textureDepth; i++) { setImage(i, copyop(text._images[i].get())); - _modifiedCount.push_back(ImageModifiedCount()); } }