diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-02 11:25:29 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-02 11:38:59 +0100 |
commit | ae850353151cd6a79f7b4a012d0a411013c841a4 (patch) | |
tree | d6f255548d2916a88378d232265f6bee5430ec7b /vcl | |
parent | e9ae1b64af9b38669476bbcb38a033000149b60f (diff) |
Resolves: tdf#92993 access violation on particular .docx on glyph layout
Change-Id: I69dfd6747e37ddb1727dd41b99d1b70eaed83425
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/sallayout.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 0154aaafedee..eefcd57e23af 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -1650,8 +1650,9 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs ) maFallbackRuns[n].ResetPos(); // get the next codepoint index that needs fallback int nActiveCharPos = nCharPos[0]; + int nActiveCharIndex = nActiveCharPos - mnMinCharPos; // get the end index of the active run - int nLastRunEndChar = (vRtl[nActiveCharPos - mnMinCharPos])? + int nLastRunEndChar = (nActiveCharIndex >= 0 && vRtl[nActiveCharIndex]) ? rArgs.mnEndCharPos : rArgs.mnMinCharPos - 1; int nRunVisibleEndChar = nCharPos[0]; // merge the fallback levels @@ -1800,7 +1801,8 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs ) if( !bLTR ) nOldRunAdv = -nOldRunAdv; #endif - if (vRtl[nActiveCharPos - mnMinCharPos]) + nActiveCharIndex = nActiveCharPos - mnMinCharPos; + if (nActiveCharIndex >= 0 && vRtl[nActiveCharIndex]) { if (nRunVisibleEndChar > mnMinCharPos && nRunVisibleEndChar <= mnEndCharPos) nRunAdvance -= aMultiArgs.mpDXArray[nRunVisibleEndChar - 1 - mnMinCharPos]; |