fixed potential buffer size overflow in Boost::update_weight, bug #1524 (thanks to benlemna for the patch)
This commit is contained in:
@@ -1126,7 +1126,7 @@ CvBoost::update_weights( CvBoostTree* tree )
|
|||||||
int *sample_idx_buf;
|
int *sample_idx_buf;
|
||||||
const int* sample_idx = 0;
|
const int* sample_idx = 0;
|
||||||
cv::AutoBuffer<uchar> inn_buf;
|
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 )
|
if( !tree )
|
||||||
_buf_size += n*sizeof(int);
|
_buf_size += n*sizeof(int);
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user