mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 13:47:32 +08:00
Merge pull request #4158 from alalek:fix-bigdata-copyto
This commit is contained in:
commit
743160b6ac
@ -293,11 +293,17 @@ void Mat::copyTo( OutputArray _dst ) const
|
||||
const uchar* sptr = data;
|
||||
uchar* dptr = dst.data;
|
||||
|
||||
CV_IPP_RUN(
|
||||
(size_t)cols*elemSize() <= (size_t)INT_MAX &&
|
||||
(size_t)step <= (size_t)INT_MAX &&
|
||||
(size_t)dst.step <= (size_t)INT_MAX
|
||||
,
|
||||
ippiCopy_8u_C1R(sptr, (int)step, dptr, (int)dst.step, ippiSize((int)(cols*elemSize()), rows)) >= 0
|
||||
)
|
||||
|
||||
Size sz = getContinuousSize(*this, dst);
|
||||
size_t len = sz.width*elemSize();
|
||||
|
||||
CV_IPP_RUN(true, ippiCopy_8u_C1R(sptr, (int)step, dptr, (int)dst.step, ippiSize((int)len, sz.height)) >= 0)
|
||||
|
||||
for( ; sz.height--; sptr += step, dptr += dst.step )
|
||||
memcpy( dptr, sptr, len );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user