From 07c10d6fc3a5e697aba2e9b34586d2bafef2ce85 Mon Sep 17 00:00:00 2001 From: Vitaly Tuzov Date: Thu, 7 Feb 2019 15:58:34 +0300 Subject: [PATCH] Fixed out of bound reading issue in erode() and dilate() --- modules/imgproc/src/morph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/imgproc/src/morph.cpp b/modules/imgproc/src/morph.cpp index cb25a50c7b..c18e5c8066 100644 --- a/modules/imgproc/src/morph.cpp +++ b/modules/imgproc/src/morph.cpp @@ -159,7 +159,7 @@ template struct MorphRowVec i += vtype::nlanes/2; } - return i; + return i - i % cn; } int ksize, anchor;