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

coverity#1242531 Untrusted loop bound

Change-Id: I94308a517028a62ecf7018f6d7a4e9d37c0f56a6
üst 95e93e9a
...@@ -1551,6 +1551,12 @@ SvStream& ReadPolygon( SvStream& rIStream, Polygon& rPoly ) ...@@ -1551,6 +1551,12 @@ SvStream& ReadPolygon( SvStream& rIStream, Polygon& rPoly )
{ {
// Determine whether we need to write through operators // Determine whether we need to write through operators
const size_t nMaxRecordsPossible = rIStream.remainingSize() / (2 * sizeof(sal_Int32));
if (nPoints > nMaxRecordsPossible)
{
SAL_WARN("tools", "Polygon claims " << nPoints << " records, but only " << nMaxRecordsPossible << " possible");
nPoints = nMaxRecordsPossible;
}
#if (SAL_TYPES_SIZEOFLONG) == 4 #if (SAL_TYPES_SIZEOFLONG) == 4
#ifdef OSL_BIGENDIAN #ifdef OSL_BIGENDIAN
if ( rIStream.GetNumberFormatInt() == NUMBERFORMAT_INT_BIGENDIAN ) if ( rIStream.GetNumberFormatInt() == NUMBERFORMAT_INT_BIGENDIAN )
......
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