Kaydet (Commit) 23c16ec4 authored tarafından Thorsten Behrens's avatar Thorsten Behrens

Fix abort from stl debug iterators' invalid access.

Triggered by fdo#43725, incrementing an invalid iterator bombs -
though this seems a corner case, depends on whether one considers
"+= 0" as incrementing or not.
üst 7b7c3b6e
......@@ -84,7 +84,8 @@ public:
{
// add nCount copies of rPolygon
PolygonVector::iterator aIndex(maPolygons.begin());
aIndex += nIndex;
if( nIndex )
aIndex += nIndex;
maPolygons.insert(aIndex, nCount, rPolygon);
}
}
......@@ -93,7 +94,8 @@ public:
{
// add all polygons from rPolyPolygon
PolygonVector::iterator aIndex(maPolygons.begin());
aIndex += nIndex;
if( nIndex )
aIndex += nIndex;
maPolygons.insert(aIndex, rPolyPolygon.begin(), rPolyPolygon.end());
}
......
......@@ -83,7 +83,8 @@ public:
{
// add nCount copies of rPolygon
PolygonVector::iterator aIndex(maPolygons.begin());
aIndex += nIndex;
if( nIndex )
aIndex += nIndex;
maPolygons.insert(aIndex, nCount, rPolygon);
}
}
......@@ -92,7 +93,8 @@ public:
{
// add all polygons from rPolyPolygon
PolygonVector::iterator aIndex(maPolygons.begin());
aIndex += nIndex;
if( nIndex )
aIndex += nIndex;
maPolygons.insert(aIndex, rPolyPolygon.begin(), rPolyPolygon.end());
}
......
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