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:
@@ -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 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user