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:
@@ -44,6 +44,7 @@
|
|||||||
|
|
||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
#include "opencv2/core/hal/intrin.hpp"
|
#include "opencv2/core/hal/intrin.hpp"
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
namespace cv {
|
namespace cv {
|
||||||
CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN
|
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);
|
borderLeft*sizeof(T), inplace);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ref = (const T*)(src+(srcY-roi.y)*srcStep);
|
ref = (const T*)(src+(srcY-roi.y)*(ptrdiff_t)srcStep);
|
||||||
|
|
||||||
S = ref;
|
S = ref;
|
||||||
R = (T*)alignPtr(border, VEC_ALIGN);
|
R = (T*)alignPtr(border, VEC_ALIGN);
|
||||||
|
|||||||
Reference in New Issue
Block a user