This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 41b1ea0b1b491f9063dee31fda15ac1378f2562e
Author: Arrigo Marchiori <[email protected]>
AuthorDate: Sat Dec 6 20:40:57 2025 +0100

    Do not assume that mvGlyph2Char and mvChar2BaseGlyph are the same size
    
    (cherry picked from commit 5f25d23e55fd7822fe37e92fe4caabc745b69349)
---
 main/vcl/source/glyphs/graphite_layout.cxx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/main/vcl/source/glyphs/graphite_layout.cxx 
b/main/vcl/source/glyphs/graphite_layout.cxx
index 95dd7ee592..d54c732d9f 100644
--- a/main/vcl/source/glyphs/graphite_layout.cxx
+++ b/main/vcl/source/glyphs/graphite_layout.cxx
@@ -1048,7 +1048,11 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs 
&rArgs)
                     size_t nCharIndex = mvGlyph2Char[i];
                     mvCharDxs[nCharIndex] += nOffset;
                     // adjust char dxs for rest of characters in cluster
-                    while (++nCharIndex < mvGlyph2Char.size())
+                    // Bug #126768: vectors mvGlyph2Char and mvChar2BaseGlyph 
may have different sizes
+                    size_t nMaxCharIndex = mvGlyph2Char.size();
+                    if ( nMaxCharIndex > mvChar2BaseGlyph.size() )
+                        nMaxCharIndex = mvChar2BaseGlyph.size();
+                    while ( ++nCharIndex < nMaxCharIndex )
                     {
                         int nChar2Base = (mvChar2BaseGlyph[nCharIndex] == -1)? 
-1 : (int)(mvChar2BaseGlyph[nCharIndex] & GLYPH_INDEX_MASK);
                         if (nChar2Base == -1 || nChar2Base == 
static_cast<int>(i))

Reply via email to