From: Vadim Pisarevsky Date: Tue, 9 Nov 2010 15:45:56 +0000 (+0000) Subject: put extra check to cv::findChessboardCorners (ticket #648) X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~8469 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9130d5bae10e203784a8fe25dd6afe6f2da97652;p=platform%2Fupstream%2Fopencv.git put extra check to cv::findChessboardCorners (ticket #648) --- diff --git a/modules/calib3d/src/calibinit.cpp b/modules/calib3d/src/calibinit.cpp index c5c62d7..b6083fa 100644 --- a/modules/calib3d/src/calibinit.cpp +++ b/modules/calib3d/src/calibinit.cpp @@ -1904,7 +1904,8 @@ bool findChessboardCorners( const Mat& image, Size patternSize, CvMat _image = image; bool ok = cvFindChessboardCorners(&_image, patternSize, (CvPoint2D32f*)&corners[0], &count, flags ) > 0; - corners.resize(count); + if(count >= 0) + corners.resize(count); return ok; }