From 5633cf0379b3cf3cb268a869e51e9637b49c0476 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Mon, 13 Dec 2010 16:53:46 +0000 Subject: [PATCH] one more fix in the recently rewritten copyMakeBorder --- modules/imgproc/src/utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/imgproc/src/utils.cpp b/modules/imgproc/src/utils.cpp index 217dfc3a3..88d489db3 100644 --- a/modules/imgproc/src/utils.cpp +++ b/modules/imgproc/src/utils.cpp @@ -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;