From Julien Valentin, "Serializing custom geometry i ran into a crash due to a
setVertexAttribArrayList(array) with array containing NULL vertexAttrib.
I added a test in order to avoid it
Code:
void Geometry::setVertexAttribArrayList(const ArrayList& arrayList)
{
_vertexAttribList = arrayList;
dirtyDisplayList();
if (_useVertexBufferObjects)
{
for(ArrayList::iterator itr = _vertexAttribList.begin();
itr != _vertexAttribList.end();
++itr)
{
if(itr->get())//ADDED
addVertexBufferObjectIfRequired(itr->get());
}
}
}
"
and
"The bug i ran into is a crash reading osgt Geometry with null vertexattribs.
The only thing i added is a not nul check on array passed to setVertexAttribArrayList."
--------------------This line, and those below, will be ignored--
M src/osg/Geometry.cpp
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15121 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
@@ -201,7 +201,7 @@ void Geometry::setTexCoordArrayList(const ArrayList& arrayList)
|
||||
itr != _texCoordList.end();
|
||||
++itr)
|
||||
{
|
||||
addVertexBufferObjectIfRequired(itr->get());
|
||||
if (itr->get()) addVertexBufferObjectIfRequired(itr->get());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -244,7 +244,7 @@ void Geometry::setVertexAttribArrayList(const ArrayList& arrayList)
|
||||
itr != _vertexAttribList.end();
|
||||
++itr)
|
||||
{
|
||||
addVertexBufferObjectIfRequired(itr->get());
|
||||
if (itr->get()) addVertexBufferObjectIfRequired(itr->get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user