Commit a7a0f92e authored by Jonathan Bohren's avatar Jonathan Bohren

Fixing segfault for near-zero-sized ellipses

parent 87563c66
......@@ -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);
}
}
......
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