From 2219e38192f030ea3f5200280ef18fe6f1cdc74b Mon Sep 17 00:00:00 2001 From: Vincent Rabaud Date: Thu, 16 Feb 2012 19:21:48 +0000 Subject: [PATCH] fix a potential crash when there are no keypoints --- modules/features2d/src/orb.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/features2d/src/orb.cpp b/modules/features2d/src/orb.cpp index 97f2d7a0e9..e878cff0cb 100644 --- a/modules/features2d/src/orb.cpp +++ b/modules/features2d/src/orb.cpp @@ -891,6 +891,8 @@ void ORB::operator()(const Mat &image_in, const Mat &mask, vector & ke // Get the features and compute their orientation vector& keypoints = all_keypoints[level]; int nkeypoints = (int)keypoints.size(); + if (nkeypoints==0) + continue; // Compute the descriptors if (do_descriptors)