From dcc2512f581f56fb887ae955ebe828071dee7b92 Mon Sep 17 00:00:00 2001 From: Naer Chang Date: Sat, 14 Mar 2015 02:56:29 -0400 Subject: [PATCH 1/2] issue 3710 added a check to prevent illegal access to operator[] when vector is empty --- modules/objdetect/src/cascadedetect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/objdetect/src/cascadedetect.cpp b/modules/objdetect/src/cascadedetect.cpp index 1c0bbf1b0b..e34d5f6efa 100644 --- a/modules/objdetect/src/cascadedetect.cpp +++ b/modules/objdetect/src/cascadedetect.cpp @@ -1268,7 +1268,7 @@ void CascadeClassifierImpl::detectMultiScaleNoGrouping( InputArray _image, std:: scales.push_back((float)factor); } - if( !featureEvaluator->setImage(gray, scales) ) + if ( scales.size() == 0 || !featureEvaluator->setImage(gray, scales) ) return; // OpenCL code From cdc9bc397dbb9667cdb742973b1f89e000b315a6 Mon Sep 17 00:00:00 2001 From: Naer Chang Date: Sat, 14 Mar 2015 18:32:46 -0400 Subject: [PATCH 2/2] Revert "issue 3710" Trying to fix whitespace issue. This reverts commit dcc2512f581f56fb887ae955ebe828071dee7b92. --- modules/objdetect/src/cascadedetect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/objdetect/src/cascadedetect.cpp b/modules/objdetect/src/cascadedetect.cpp index e34d5f6efa..af94fac0e4 100644 --- a/modules/objdetect/src/cascadedetect.cpp +++ b/modules/objdetect/src/cascadedetect.cpp @@ -1268,7 +1268,7 @@ void CascadeClassifierImpl::detectMultiScaleNoGrouping( InputArray _image, std:: scales.push_back((float)factor); } - if ( scales.size() == 0 || !featureEvaluator->setImage(gray, scales) ) + if( scales.size() == 0 || !featureEvaluator->setImage(gray, scales) ) return; // OpenCL code