Hi Gerrit,

I think I found a bug in the AspectStore::setPtrForFunction:

inline
void AspectStore::setPtrForAspect(FieldContainerPtr pContainer, 
                                  UInt32            uiAspect  )
{
    _vAspects.resize(uiAspect + 1, NULL);
    
    _vAspects[uiAspect] = pContainer;
}

The way I understand it, FieldContainers can exist in some aspects but
be destroyed/not created yet in others. The resize above assumes that
containers are created in aspects in increasing order for otherwise the
_vAspects vector actually shrinks and access to aspects with higher
numbers are out of bounds.
This:

_vAspects.resize(osgMax(_vAspects.size(), uiAspect + 1), NULL);

should be safer.

Comments ?

        Thanks, 
                Carsten


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core

Reply via email to