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
This commit is contained in:
Robert Osfield
2015-03-31 19:31:34 +00:00
parent 5229280901
commit de415fbcf9

View File

@@ -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.