Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Michael Stahl píše v St 29. 02. 2012 v 23:08 +0100:
this patch fixes a STL assertion in GraphiteLayout::expandOrCondense;
since i don't know how the multitude of arrays in there are supposed to
be used, i thought it's probably a good idea to check the size of the
array that will be indexed in the next line, as opposed to one that
isn't mentioned in the block...

in case this is the right fix, it should be applied to libreoffice-3-5,
and possibly libreoffice-3-4 as well (haven't checked).

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d066f7e4afb3c9e395932ba7bf8715ad0770bcdd

I do not understand the code either. I just wonder if it would make
sense to check for:

        while (++nCharIndex - mnMinCharPos <
                    static_cast<int>(mvChar2BaseGlyph.size()))

As the array is accessed as mvChar2BaseGlyph[nCharIndex-mnMinCharPos].
Otherwise, the cycle might end too early. 

Another conservative solution would be to combine it with the original
check:

while (++nCharIndex < static_cast<int>(mvGlyph2Char.size()) &&
       nCharIndex - mnMinCharPos <
                        static_cast<int>(mvChar2BaseGlyph.size()))


Best Regards,
Petr


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.