Kaydet (Commit) ad3595ca authored tarafından Caolán McNamara's avatar Caolán McNamara

forcepoint#53 restrict to expected index range

Change-Id: I22f01e5a3e3cf51b014ac841cd14071dce5baf0f
Reviewed-on: https://gerrit.libreoffice.org/57920
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst d0f44c46
......@@ -574,13 +574,18 @@ bool GenericSalLayout::LayoutText(ImplLayoutArgs& rArgs)
bool GenericSalLayout::GetCharWidths(DeviceCoordinate* pCharWidths) const
{
int nCharCount = mnEndCharPos - mnMinCharPos;
const int nCharCount = mnEndCharPos - mnMinCharPos;
for (int i = 0; i < nCharCount; ++i)
pCharWidths[i] = 0;
for (auto const& aGlyphItem : m_GlyphItems)
pCharWidths[aGlyphItem.mnCharPos - mnMinCharPos] += aGlyphItem.mnNewWidth;
{
const int nIndex = aGlyphItem.mnCharPos - mnMinCharPos;
if (nIndex >= nCharCount)
continue;
pCharWidths[nIndex] += aGlyphItem.mnNewWidth;
}
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment