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
This commit is contained in:
Robert Osfield
2014-11-20 09:41:27 +00:00
parent 7ae45b7ac2
commit b4354df6fb

View File

@@ -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());
}
}