one more fix in the recently rewritten copyMakeBorder
authorVadim Pisarevsky <no@email>
Mon, 13 Dec 2010 16:53:46 +0000 (16:53 +0000)
committerVadim Pisarevsky <no@email>
Mon, 13 Dec 2010 16:53:46 +0000 (16:53 +0000)
modules/imgproc/src/utils.cpp

index 217dfc3..88d489d 100644 (file)
@@ -113,7 +113,7 @@ static void copyMakeBorder_8u( const uchar* src, int srcstep, Size srcroi,
     left *= cn;
     right *= cn;
     
-    uchar* dstInner = dst + (dststep*top + left)*elemSize;
+    uchar* dstInner = dst + dststep*top + left*elemSize;
 
     for( i = 0; i < srcroi.height; i++, dstInner += dststep, src += srcstep )
     {
@@ -183,7 +183,7 @@ static void copyMakeConstBorder_8u( const uchar* src, int srcstep, Size srcroi,
         if( dstInner != src )
             memcpy( dstInner, src, srcroi.width );
         memcpy( dstInner - left, constBuf, left );
-        memcpy( dstInner + srcroi.width, constBuf + left, right );
+        memcpy( dstInner + srcroi.width, constBuf, right );
     }
     
     dst += dststep*top;