未验证 提交 6e1da2ef 编写于 作者: Z Zhuo Zhang 提交者: GitHub

Merge pull request #19203 from zchrissirhcz:fix-cvSaveImage

Fix cvSaveImage( ) function bug

* fix cvSaveImage crash

* replace emplace_back with {}, no C++11 required

* fix MacOSX build with vector's push_back
上级 1ec2ade6
......@@ -1065,7 +1065,9 @@ cvSaveImage( const char* filename, const CvArr* arr, const int* _params )
for( ; _params[i] > 0; i += 2 )
CV_Assert(static_cast<size_t>(i) < cv::CV_IO_MAX_IMAGE_PARAMS*2); // Limit number of params for security reasons
}
return cv::imwrite_(filename, cv::cvarrToMat(arr),
std::vector<cv::Mat> img_vec;
img_vec.push_back(cv::cvarrToMat(arr));
return cv::imwrite_(filename, img_vec,
i > 0 ? std::vector<int>(_params, _params+i) : std::vector<int>(),
CV_IS_IMAGE(arr) && ((const IplImage*)arr)->origin == IPL_ORIGIN_BL );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册