Fixing segfault for near-zero-sized ellipses

This commit is contained in:
Jonathan Bohren 2013-03-20 16:49:59 -04:00
parent 87563c6638
commit a7a0f92e58

View File

@ -890,8 +890,10 @@ void ellipse2Poly( Point center, Size axes, int angle,
pts.push_back(pt);
}
if( pts.size() < 2 )
pts.push_back(pts[0]);
// If there are no points, it's a zero-size polygon
if( pts.size() < 2) {
pts.assign(2,center);
}
}