diff --git a/src/osg/ImageSequence.cpp b/src/osg/ImageSequence.cpp index 8faec34e8..344fa81c7 100644 --- a/src/osg/ImageSequence.cpp +++ b/src/osg/ImageSequence.cpp @@ -353,10 +353,10 @@ void ImageSequence::update(osg::NodeVisitor* nv) if (useDirectTimeRequest) { - int i = int(time/_timePerImage); + int i = osg::maximum(0, int(time/_timePerImage)); if ((i>=int(_imageDataList.size()) || !_imageDataList[i]._image)) { - i = osg::clampTo(i, 0, _imageDataList.size()-1); + i = osg::minimum(i, _imageDataList.size()-1); OSG_INFO<<"Requesting file, entry="<second->impl_->Socket(), &tempfds ) ){ - + printf("UdpSocket::Run() reading from socket \n"); int size = i->second->ReceiveFrom( remoteEndpoint, data, MAX_BUFFER_SIZE ); if( size > 0 ){ i->first->ProcessPacket( data, size, remoteEndpoint );