diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-02 11:25:29 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-08 07:32:42 +0000 |
commit | 92eed31707e655e484e263fee2b0c0ae93d73748 (patch) | |
tree | 71623103ac1c0b38f8acbb5ea3415d82d9293f21 | |
parent | 48a7d0492dbae60d644dd7be9b1b0826fdf36f63 (diff) |
Resolves: tdf#92993 access violation on particular .docx on glyph layout
Change-Id: I69dfd6747e37ddb1727dd41b99d1b70eaed83425
(cherry picked from commit ae850353151cd6a79f7b4a012d0a411013c841a4)
Reviewed-on: https://gerrit.libreoffice.org/19095
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-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 69d162ffd76b..4bd388d38b4c 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -1720,8 +1720,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 @@ -1870,7 +1871,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]; |