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

Related: fdo#47644 get out of bounds conditions right

Change-Id: Icac9a8337296f92af5007a051f00388a64955178
üst a24a9804
......@@ -455,17 +455,14 @@ sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos )
}
else
{
size_t nBgnDistance = std::distance(m_aPagesCache.begin(), aI);
size_t nBgnIndex = std::distance(m_aPagesCache.begin(), aI);
size_t nIndex = nBgnIndex + nRel;
size_t nIndex = nBgnDistance + nRel;
if (nIndex > m_aPagesCache.size())
{
nRel = m_aPagesCache.size() - nBgnDistance;
if (nIndex >= m_aPagesCache.size())
nIndex = m_aPagesCache.size() - 1;
}
else
nRel = 0;
size_t nSuccessfulStepsTaken = nIndex - nBgnIndex;
nRel -= nSuccessfulStepsTaken;
nLast = nIndex ? m_aPagesCache[nIndex - 1] : STG_EOF;
nBgn = m_aPagesCache[nIndex];
......
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