summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-10-02 11:25:29 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-10-02 11:38:59 +0100
commitae850353151cd6a79f7b4a012d0a411013c841a4 (patch)
treed6f255548d2916a88378d232265f6bee5430ec7b /vcl
parente9ae1b64af9b38669476bbcb38a033000149b60f (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.cxx6
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];