mirror of
https://github.com/opencv/opencv.git
synced 2025-01-19 06:53:50 +08:00
Fixing segfault for near-zero-sized ellipses
This commit is contained in:
parent
87563c6638
commit
a7a0f92e58
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user