[osg-submissions] Crash at loading .ive-models
Валерий Быков
valery.bickov at gmail.com
Sun Jan 13 02:44:53 PST 2008
Hi Robert.
Code files DrawElementsUByte.cpp, DrawElementsUInt.cpp and
DrawElementsUShort.cpp contain the same error, for example, in
DrawElementsUShort.cpp:
the function write(DataOutputStream* out) calls out->writeCharArray((const
char*)&front(), size() * SHORTSIZE); without checking size() != 0 and the
function read(DataInputStream* in) calls in->readCharArray((char*)&front(),
size * SHORTSIZE); also without checking size != 0. In some realizations of
STL (eg MSVS 2005) if you try to get front() from zero-size vector, program
crashes.
I therefore suggest to insert checking of size. Fixed files is attached.
Note. May be design of .ive format suggests that size never been equal zero,
but in practice I met such files.
Thanks,
Valery
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20080113/66441bff/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixes.zip
Type: application/octet-stream
Size: 3304 bytes
Desc: not available
Url : http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20080113/66441bff/attachment.obj
More information about the osg-submissions
mailing list