From 1e996afe819bff6a38f77e889cc3c8e9ca096070 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 16 Dec 2007 17:46:57 +0000 Subject: [PATCH] From Wojciech Lewandowski, "osgSim::BlinkSequence has sequenceGroup unitialized by default (=NULL ref_ptr). By looking at the code I figured out that unset sequenceGroup is completely correct and thus allowed. But writing BlinkSequence with empty sequence group caused a crash when IVE was accessing baseTime from NULL address. Atttached is a fix for this situation. " --- src/osgPlugins/ive/BlinkSequence.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/ive/BlinkSequence.cpp b/src/osgPlugins/ive/BlinkSequence.cpp index 0c8fbd045..532a593cd 100644 --- a/src/osgPlugins/ive/BlinkSequence.cpp +++ b/src/osgPlugins/ive/BlinkSequence.cpp @@ -43,7 +43,10 @@ void BlinkSequence::write(DataOutputStream* out){ // Write out phase shift. out->writeDouble(getPhaseShift()); // Write out SequenceGroup. - out->writeDouble(getSequenceGroup()->_baseTime); + if( getSequenceGroup() ) + out->writeDouble(getSequenceGroup()->_baseTime); + else + out->writeDouble( 0.0 ); } @@ -73,7 +76,6 @@ void BlinkSequence::read(DataInputStream* in){ setPhaseShift(in->readDouble()); // Read in SequenceGroup setSequenceGroup(new osgSim::SequenceGroup(in->readDouble())); - } else{ throw Exception("BlinkSequence::read(): Expected BlinkSequence identification.");