Hi Ulises,

On 14/07/12 8:55 , Ulises Rainoldi wrote:
> After debuging a little, I've found out that the method 
> IndexedLightPoint::readRecord
> (RecordInputStream& in, Document& document) was setting the 
> osgSim::LightPointNode's
> maxPixelSize to zero. This is causing a index out of range exception 
> afterwards in the
> draw traversal...
> 
> I've solved this problem by simply adding a check for zero before setting the 
>  maxPixelSize read from the file.
> 
>>
>> --- /tmp/LightPointRecords-0.2.cpp
>> +++ 
>> /home/ulises/Development/OpenSceneGrpah/trunk/src/osgPlugins/OpenFlight/LightPointRecords.cpp
>> @@ -392,7 +392,8 @@
>>          if (_appearance.valid())
>>          {
>>              _lpn->setMinPixelSize(_appearance->minPixelSize);
>> -            _lpn->setMaxPixelSize(_appearance->maxPixelSize);
>> +            if (_appearance->maxPixelSize > 0)
>> +                _lpn->setMaxPixelSize(_appearance->maxPixelSize);
>>  
>>              if (_appearance->texturePatternIndex != -1)
>>              {

If a max. pixel size of 0 is a problem it makes more sense to put this 'if 
(value > 0)'
check into the setter so that all callers benefit.

Or put the check even closer to the crash site and make sure it is happy with 
what's
coming in and maybe return without any changes?

Cheers,
/ulrich

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to