Fixing segfault for near-zero-sized ellipses

pull/681/head
Jonathan Bohren 12 years ago
parent 87563c6638
commit a7a0f92e58
  1. 6
      modules/core/src/drawing.cpp

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

Loading…
Cancel
Save