Kaydet (Commit) c93f5034 authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Andras Timar

forcepoint#53 restrict to expected index range

Change-Id: I22f01e5a3e3cf51b014ac841cd14071dce5baf0f
Reviewed-on: https://gerrit.libreoffice.org/57922
Tested-by: Jenkins
Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
(cherry picked from commit fa82b6a5)
üst c21a5229
...@@ -815,13 +815,18 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs) ...@@ -815,13 +815,18 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
bool CommonSalLayout::GetCharWidths(DeviceCoordinate* pCharWidths) const bool CommonSalLayout::GetCharWidths(DeviceCoordinate* pCharWidths) const
{ {
int nCharCount = mnEndCharPos - mnMinCharPos; const int nCharCount = mnEndCharPos - mnMinCharPos;
for (int i = 0; i < nCharCount; ++i) for (int i = 0; i < nCharCount; ++i)
pCharWidths[i] = 0; pCharWidths[i] = 0;
for (auto const& aGlyphItem : m_GlyphItems) 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; 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