fixed MatConstIterator<> (ticket #776)

This commit is contained in:
Vadim Pisarevsky
2010-12-26 22:18:30 +00:00
parent 86802ec968
commit a379d011fd
2 changed files with 2 additions and 2 deletions

View File

@@ -2203,7 +2203,7 @@ void MatConstIterator::seek(ptrdiff_t ofs, bool relative)
y = ofs/m->cols;
int y1 = std::min(std::max((int)y, 0), m->rows-1);
sliceStart = m->data + y1*m->step[0];
sliceEnd = sliceStart + (m->cols-1)*elemSize;
sliceEnd = sliceStart + m->cols*elemSize;
ptr = y < 0 ? sliceStart : y >= m->rows ? sliceEnd :
sliceStart + (ofs - y*m->cols)*elemSize;
return;