Page 1 of 1

A lot of space will crash

Posted: Fri Sep 21, 2012 07:07
by kili
I download ceed-snapshot10 and use StockDatafiles1_0.project.
In Demo8.layout, when i input a lot of space in root/Demo8/Window1/Controls/ins1,
the Editor crashed.

I found that it will loop infinitely in

Code: Select all

void RenderedStringWordWrapper<JustifiedRenderedString>::format(const Size& area_size)
{
    deleteFormatters();

    RenderedString rstring, lstring;
    rstring = *d_renderedString;
    float rs_width;

    FormattedRenderedString* frs;

    for (size_t line = 0; line < rstring.getLineCount(); ++line)
    {
        while ((rs_width = rstring.getPixelSize(line).d_width) > 0)        //here
        {
            // skip line if no wrapping occurs
            if (rs_width <= area_size.d_width)
                break;

            // split rstring at width into lstring and remaining rstring
            rstring.split(line, area_size.d_width, lstring);
            frs = new JustifiedRenderedString(*new RenderedString(lstring));
            frs->format(area_size);
            d_lines.push_back(frs);
            line = 0;
        }
    }

    // last line (which we do not justify)
    frs = new LeftAlignedRenderedString(*new RenderedString(rstring));
    frs->format(area_size);
    d_lines.push_back(frs);
}



I'm sorry for no log, seems out of memory.

Re: A lot of space will crash

Posted: Tue Oct 02, 2012 16:50
by Kulik
Seems like a bug in CEGUI, I will investigate and report back.