0
0
mirror of https://github.com/opencv/opencv.git synced 2026-01-18 17:21:42 +01:00

Fix potential pointer overflow.

srcY-roi.y is promoted to size_t which creates problems when it is
negative.
This commit is contained in:
Vincent Rabaud
2026-01-06 00:48:59 +01:00
parent f3758f40ae
commit e9c6cb98ea

View File

@@ -44,6 +44,7 @@
#include "precomp.hpp"
#include "opencv2/core/hal/intrin.hpp"
#include <cstddef>
namespace cv {
CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN
@@ -1513,7 +1514,7 @@ void BlockSum(const Mat& _src, Mat& _dst, Size ksize, Point anchor, const Size &
borderLeft*sizeof(T), inplace);
}
else
ref = (const T*)(src+(srcY-roi.y)*srcStep);
ref = (const T*)(src+(srcY-roi.y)*(ptrdiff_t)srcStep);
S = ref;
R = (T*)alignPtr(border, VEC_ALIGN);