1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Merge pull request #28655 from usernotfound-101:cvmixchannels-warning-fix

Add static integer casting for cvMixChannels, safer
This commit is contained in:
Alexander Smorkalov
2026-03-20 10:25:38 +03:00
committed by GitHub
+3 -1
View File
@@ -83,7 +83,9 @@ cvMixChannels( const CvArr** src, int src_count,
CvArr** dst, int dst_count,
const int* from_to, int pair_count )
{
cv::AutoBuffer<cv::Mat> buf(src_count + dst_count);
CV_Assert(src_count >= 0 && dst_count >= 0);
size_t buf_size = static_cast<size_t>(src_count) + static_cast<size_t>(dst_count);
cv::AutoBuffer<cv::Mat> buf(buf_size);
int i;
for( i = 0; i < src_count; i++ )