From 0d55ccac74ee30b1a632334062423d2f1712d621 Mon Sep 17 00:00:00 2001 From: Maria Dimashova Date: Fri, 5 Aug 2011 14:04:38 +0000 Subject: [PATCH] added check of output image in drawKeypoints() --- modules/features2d/src/draw.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/features2d/src/draw.cpp b/modules/features2d/src/draw.cpp index 45ee5862f0..b8dece6d43 100755 --- a/modules/features2d/src/draw.cpp +++ b/modules/features2d/src/draw.cpp @@ -54,6 +54,7 @@ namespace cv */ static inline void _drawKeypoint( Mat& img, const KeyPoint& p, const Scalar& color, int flags ) { + CV_Assert( !img.empty() ); Point center( cvRound(p.pt.x * draw_multiplier), cvRound(p.pt.y * draw_multiplier) ); if( flags & DrawMatchesFlags::DRAW_RICH_KEYPOINTS ) @@ -111,6 +112,7 @@ void drawKeypoints( const Mat& image, const vector& keypoints, Mat& ou RNG& rng=theRNG(); bool isRandColor = _color == Scalar::all(-1); + CV_Assert( !outImage.empty() ); for( vector::const_iterator i = keypoints.begin(), ie = keypoints.end(); i != ie; ++i ) { Scalar color = isRandColor ? Scalar(rng(256), rng(256), rng(256)) : _color; -- GitLab