Merge pull request #4159 from alalek:vector_processing

This commit is contained in:
Alexander Alekhin
2015-07-06 13:22:57 +00:00
4 changed files with 89 additions and 0 deletions

View File

@@ -285,6 +285,11 @@ void Mat::copyTo( OutputArray _dst ) const
if( rows > 0 && cols > 0 )
{
// For some cases (with vector) dst.size != src.size, so force to column-based form
// It prevents memory corruption in case of column-based src
if (_dst.isVector())
dst = dst.reshape(0, (int)dst.total());
const uchar* sptr = data;
uchar* dptr = dst.data;