From 24e2a008c3a4ace0394fff16fa0c2cf3094d96e1 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Thu, 25 Jun 2015 19:59:27 +0300 Subject: [PATCH] copyTo: fix for big data (4Gb+) --- modules/core/src/copy.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/core/src/copy.cpp b/modules/core/src/copy.cpp index 0d483ed..67b81c4 100644 --- a/modules/core/src/copy.cpp +++ b/modules/core/src/copy.cpp @@ -288,11 +288,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 ); } -- 2.7.4