From 366fcbf59b9fd97498bc711648de8dc0bb0fbd26 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 30 Jan 2013 10:21:45 +0000 Subject: [PATCH] From Stephan Huber, "As I have not all referenced image-data, SlideShowConstructor crashed on my end. Attached is a fix for that crash." --- src/osgPresentation/SlideShowConstructor.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/osgPresentation/SlideShowConstructor.cpp b/src/osgPresentation/SlideShowConstructor.cpp index c345818df..b0475dc2c 100644 --- a/src/osgPresentation/SlideShowConstructor.cpp +++ b/src/osgPresentation/SlideShowConstructor.cpp @@ -1100,11 +1100,12 @@ osg::Image* SlideShowConstructor::readImage(const std::string& filename, const I image = imageSequence; } - - if (imageData.delayTime>0.0) image->setUserValue("delay",imageData.delayTime); - if (imageData.startTime>0.0) image->setUserValue("start",imageData.startTime); - if (imageData.stopTime>0.0) image->setUserValue("stop",imageData.stopTime); - + if (image.valid()) + { + if (imageData.delayTime>0.0) image->setUserValue("delay",imageData.delayTime); + if (imageData.startTime>0.0) image->setUserValue("start",imageData.startTime); + if (imageData.stopTime>0.0) image->setUserValue("stop",imageData.stopTime); + } return image.release(); }