From 6935e95c2acc4c4b5dd17be04d9fd765547947b3 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Wed, 3 Aug 2011 11:30:09 +0000 Subject: [PATCH] Fixed crash in BruteForceMatcher::clone --- modules/features2d/include/opencv2/features2d/features2d.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/features2d/include/opencv2/features2d/features2d.hpp b/modules/features2d/include/opencv2/features2d/features2d.hpp index 656647212b..30ac40ec04 100644 --- a/modules/features2d/include/opencv2/features2d/features2d.hpp +++ b/modules/features2d/include/opencv2/features2d/features2d.hpp @@ -2367,6 +2367,7 @@ Ptr BruteForceMatcher::clone( bool emptyTrainData ) BruteForceMatcher* matcher = new BruteForceMatcher(distance); if( !emptyTrainData ) { + matcher->trainDescCollection.resize(trainDescCollection.size()); std::transform( trainDescCollection.begin(), trainDescCollection.end(), matcher->trainDescCollection.begin(), clone_op ); }