From 46775ad18632fa5bf3ce8fc37dca8df935c439f3 Mon Sep 17 00:00:00 2001 From: Camille Date: Thu, 17 Jul 2014 22:57:31 +0200 Subject: [PATCH] bug fix 3381 --- modules/core/include/opencv2/core/mat.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/core/include/opencv2/core/mat.hpp b/modules/core/include/opencv2/core/mat.hpp index 5816c1f80..8e36a44db 100644 --- a/modules/core/include/opencv2/core/mat.hpp +++ b/modules/core/include/opencv2/core/mat.hpp @@ -684,6 +684,8 @@ template inline void Mat::push_back(const _Tp& elem) { if( !data ) { + CV_Assert((type()==0) || (DataType<_Tp>::type == type())); + *this = Mat(1, 1, DataType<_Tp>::type, (void*)&elem).clone(); return; }