1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

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
+4 -2
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);
}
}