From 3470f5b35bba4e33e370a01c16ed3287734c2f99 Mon Sep 17 00:00:00 2001 From: usernotfound-101 Date: Fri, 13 Mar 2026 22:25:08 +0530 Subject: [PATCH] Add static integer casting to get rid of the warning, safer --- modules/core/src/convert_c.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/core/src/convert_c.cpp b/modules/core/src/convert_c.cpp index 96beffccc6..ae93a73ebb 100644 --- a/modules/core/src/convert_c.cpp +++ b/modules/core/src/convert_c.cpp @@ -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 buf(src_count + dst_count); + CV_Assert(src_count >= 0 && dst_count >= 0); + size_t buf_size = static_cast(src_count) + static_cast(dst_count); + cv::AutoBuffer buf(buf_size); int i; for( i = 0; i < src_count; i++ )