From Laurens Voerman, "while debugging ImageSequence I had a crash, due to the very large frametimes caused by halting the program. The problem is that when the frame time exceeds the length of the entire image sequence, a looping sequence will try to read it's _imageDataList beyond its size.

fix attached for  src/osg/ImageSequence.cpp"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14293 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2014-06-26 10:24:41 +00:00
parent d82131544b
commit ed314c6d7d

View File

@ -396,17 +396,8 @@ void ImageSequence::update(osg::NodeVisitor* nv)
if (startLoadIndex<0) startLoadIndex = 0; if (startLoadIndex<0) startLoadIndex = 0;
int endLoadIndex = int(preLoadTime/_timePerImage); int endLoadIndex = int(preLoadTime/_timePerImage);
if (endLoadIndex>=int(_imageDataList.size())) if (looping && (endLoadIndex>=int(_imageDataList.size()))) endLoadIndex -= int(_imageDataList.size());
{ if (endLoadIndex>=int(_imageDataList.size())) endLoadIndex = int(_imageDataList.size())-1;
if (looping)
{
endLoadIndex -= int(_imageDataList.size());
}
else
{
endLoadIndex = int(_imageDataList.size())-1;
}
}
if (endLoadIndex<0) endLoadIndex = 0; if (endLoadIndex<0) endLoadIndex = 0;
double requestTime = time; double requestTime = time;