[osg-users] osg::Text::setBackdropType crash with a single character string

Carlo Lanzotti - DynaDream clanzotti at dynadream.com
Tue Sep 26 02:36:45 PDT 2017


Hi all,

We had to temporarly fix this problem as we have to go in production. 
The problem is in osg::Text::computeAverageGlyphWidthAndHeight() line 602:

     for (i = 0; i < _coords->size(); i += 4)

sometime it happens that _coords->size() is not multiple of 4 leading to 
an out of range access to the _coords array. To avoid the crash I fixed 
this way:

     unsigned int sz = _coords->size() - (_coords->size() % 4);

     for (i = 0; i < sz; i += 4)
     {
         ...
     }

Of course this need to be fixed in some other way as it avoid the crash 
but probably do not give the correct result.

Best Regards,

Carlo Lanzotti

Il 20/09/2017 18:35, Carlo Lanzotti ha scritto:
> Hi Robert,
>
> I’ve not tried other OS combinations yet but I made that simple test 
> in the osgtext sample too and the crash happens.
>
> I’ll see if I can reproduce it on OSX.
>
> Thank you.
>
> Carlo Lanzotti
>
> Il giorno 20 set 2017, alle ore 17:23, Robert Osfield 
> <robert.osfield at gmail.com <mailto:robert.osfield at gmail.com>> ha scritto:
>
>> Hi Carlo,
>>
>> On 20 September 2017 at 15:40, Carlo Lanzotti - DynaDream 
>> <clanzotti at dynadream.com <mailto:clanzotti at dynadream.com>> wrote:
>>
>>     OSG Version: 3.4.1 64 bit, Visual Studio 2017, Windows 10,
>>
>>
>> Have you tried any other OSG+OS combinations? Is so they exhibit the 
>> problem?
>>
>> FYI, there are so major internal changes to osgText since 3.4.x so 
>> there is changes that OSG master will address this issue.
>>
>> Cheers,
>> Robert.
>>
>>
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org 
>> <mailto:osg-users at lists.openscenegraph.org>
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


-- 
Carlo Lanzotti

DynaDream - Dynamic Laboratory

http://www.dynadream.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170926/cfe48e33/attachment.htm>


More information about the osg-users mailing list