handle huge matrices correctly (#11505)

* make sure that the matrix with more than INT_MAX elements is marked as non-continuous, and thus all the pixel-wise functions process it correctly (i.e. row-by-row, not as a single row, where integer overflow may occur when computing the total number of elements)
This commit is contained in:
Vadim Pisarevsky
2018-05-14 15:29:14 +03:00
committed by GitHub
parent c6a9de812b
commit e0dbe5cfcc
12 changed files with 101 additions and 101 deletions
+1 -1
View File
@@ -120,8 +120,8 @@ static Mat iplImageToMat(const IplImage* img, bool copyData)
}
m.datalimit = m.datastart + m.step.p[0]*m.rows;
m.dataend = m.datastart + m.step.p[0]*(m.rows-1) + esz*m.cols;
m.flags |= (m.cols*esz == m.step.p[0] || m.rows == 1 ? Mat::CONTINUOUS_FLAG : 0);
m.step[1] = esz;
m.updateContinuityFlag();
if( copyData )
{