]> rtime.felk.cvut.cz Git - opencv.git/commitdiff
fixed end-of-matrix case in MatIterator::operator += (tickets #72 and #87)
authorvp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Fri, 22 Jan 2010 19:06:31 +0000 (19:06 +0000)
committervp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Fri, 22 Jan 2010 19:06:31 +0000 (19:06 +0000)
git-svn-id: https://code.ros.org/svn/opencv/trunk@2613 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08

opencv/include/opencv/cxmat.hpp

index 92f5c2502daa61443046b5a3f56174e1e4a293d3..a80197f211a5df91f472eb43662aa1edabef45ea 100644 (file)
@@ -3377,7 +3377,10 @@ template<typename _Tp> inline MatConstIterator_<_Tp>& MatConstIterator_<_Tp>::op
         int cols = m->cols;
         ofs += pt.y*cols + pt.x;
         if( ofs > cols*m->rows )
-            ofs = cols*m->rows;
+        {
+            ptr = sliceEnd = (_Tp*)(m->data + m->step*(m->rows-1)) + cols; 
+            return *this; 
+        }
         else if( ofs < 0 )
             ofs = 0;
         pt.y = ofs/cols;