From de415fbcf909148a1cb2b5f158330f5db3ef5f90 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 31 Mar 2015 19:31:34 +0000 Subject: [PATCH] Fixed crash when using a subload callback, where the _images array is empty by _images[0] was still being accessed. git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14813 16af8721-9629-0410-8352-f15c8da7e697 --- src/osg/Texture2DArray.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osg/Texture2DArray.cpp b/src/osg/Texture2DArray.cpp index 7e3402243..2aee9e1c4 100644 --- a/src/osg/Texture2DArray.cpp +++ b/src/osg/Texture2DArray.cpp @@ -255,7 +255,7 @@ void Texture2DArray::apply(State& state) const if (textureObject && textureDepth>0) { - const osg::Image* image = _images[0].get(); + const osg::Image* image = (_images.size()>0) ? _images[0].get() : 0; if (image && getModifiedCount(0, contextID) != image->getModifiedCount()) { // compute the internal texture format, this set the _internalFormat to an appropriate value.