Hi Wang,

I can confirm that your fix works, with the models in OpenSceneGraph-Data-3.0.0 and also with a couple of my own models. I use Windows 7 64 bit and VC++ 2008 Express.

Regards,
Andreas


On 2011-07-01 03:36, Wang Rui wrote:
Hi All,

A serious problem was found that some newly added .osgt models
(spaceship, lz and dumptruck) will cause infinite loop while reading.
I've studied into the source code and guessed the reason is that
istream under Windows doesn't handle unget() in an expected way. That
is, the reading buffer may be filled somehow so that unget() will fail
and thus mark the entire stream as 'bad'. The whole loading process
will then be locked and that's what we see currently. The problem can
be located in osgPlugins/osg/AsciiStreamOperator.h,
AsciiInputIterator::matchString() method.

I tried handling the stream in some other ways but couldn't work out a
good one that could put back characters stablely. To avoid opening
another can of worms, finally I decide to rewrite some of the osgt
reader and treat the string to be wrote back as a 'pre-read' string
that would be handled later before the stream. A quick test shows that
these models can be loaded successfully after the modification.

Could you please help test the .osgt reader under Windows and other
platforms to make sure it can work? It will be appreciated if there
are enough feedbacks and bug reports before I could submit the change
with security.

Thanks,

Wang Rui


_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to