From 7a7b0bcfcbe2847708086637506acba8f3ecd832 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Thu, 10 Dec 2015 20:17:17 +0300 Subject: [PATCH] fixed the upper boundary when calling checkRange (thanks to alalek) --- modules/ml/src/data.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ml/src/data.cpp b/modules/ml/src/data.cpp index feb79d93a5..a1608e3984 100644 --- a/modules/ml/src/data.cpp +++ b/modules/ml/src/data.cpp @@ -253,7 +253,7 @@ public: if( !sampleIdx.empty() ) { CV_Assert( (sampleIdx.checkVector(1, CV_32S, true) > 0 && - checkRange(sampleIdx, true, 0, 0, nsamples-1)) || + checkRange(sampleIdx, true, 0, 0, nsamples)) || sampleIdx.checkVector(1, CV_8U, true) == nsamples ); if( sampleIdx.type() == CV_8U ) sampleIdx = convertMaskToIdx(sampleIdx);