Commit 645bb0bf authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

added size check to static Mat::diag()

parent 25261e6e
......@@ -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;
......
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