提交 e433145b 编写于 作者: V Vladislav Vinogradov

fix for Bug #3085:

weights array is only allocated for (l_count+1) elements,
but then weights[l_count+1] element is accessed.
上级 98f6a4a6
......@@ -251,7 +251,7 @@ void CvANN_MLP::create( const CvMat* _layer_sizes, int _activ_func,
buf_sz += (l_dst[0] + l_dst[l_count-1]*2)*2;
CV_CALL( wbuf = cvCreateMat( 1, buf_sz, CV_64F ));
CV_CALL( weights = (double**)cvAlloc( (l_count+1)*sizeof(weights[0]) ));
CV_CALL( weights = (double**)cvAlloc( (l_count+2)*sizeof(weights[0]) ));
weights[0] = wbuf->data.db;
weights[1] = weights[0] + l_dst[0]*2;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册