added size check to static Mat::diag()

pull/13383/head
Vadim Pisarevsky 13 years ago
parent 25261e6ebc
commit 645bb0bfbc
  1. 1
      modules/core/include/opencv2/core/mat.hpp

@ -338,6 +338,7 @@ inline Mat Mat::colRange(const Range& r) const
inline Mat Mat::diag(const Mat& d)
{
CV_Assert( d.cols == 1 );
Mat m(d.rows, d.rows, d.type(), Scalar(0)), md = m.diag();
d.copyTo(md);
return m;

Loading…
Cancel
Save