Commit 8bb422b1 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

fixed potential buffer size overflow in Boost::update_weight, bug #1524 (thanks…

fixed potential buffer size overflow in Boost::update_weight, bug #1524 (thanks to benlemna for the patch)
parent f341ce26
......@@ -1126,7 +1126,7 @@ CvBoost::update_weights( CvBoostTree* tree )
int *sample_idx_buf;
const int* sample_idx = 0;
cv::AutoBuffer<uchar> inn_buf;
int _buf_size = (params.boost_type == LOGIT) || (params.boost_type == GENTLE) ? data->sample_count*sizeof(int) : 0;
size_t _buf_size = (params.boost_type == LOGIT) || (params.boost_type == GENTLE) ? data->sample_count*sizeof(int) : 0;
if( !tree )
_buf_size += n*sizeof(int);
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment