From febd0f14c692fc381ee60cab070d589a60b0bfdb Mon Sep 17 00:00:00 2001 From: Seon-Wook Park Date: Fri, 26 Jun 2015 17:15:44 +0200 Subject: [PATCH] spatialGradient: Don't dynamically alloc C array, use vector --- modules/imgproc/src/spatialgradient.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/imgproc/src/spatialgradient.cpp b/modules/imgproc/src/spatialgradient.cpp index 644f1a3043..9a33cac33d 100644 --- a/modules/imgproc/src/spatialgradient.cpp +++ b/modules/imgproc/src/spatialgradient.cpp @@ -74,9 +74,9 @@ void spatialGradient( InputArray _src, OutputArray _dx, OutputArray _dy, // Store pointers to rows of input/output data // Padded by two rows for border handling - uchar* P_src[H+2]; - short* P_dx [H+2]; - short* P_dy [H+2]; + std::vector P_src(H+2); + std::vector P_dx (H+2); + std::vector P_dy (H+2); int i_top = 0, // Case for H == 1 && W == 1 && BORDER_REPLICATE i_bottom = H - 1,