From: peng xiao Date: Fri, 12 Apr 2013 07:43:33 +0000 (+0800) Subject: Fix a potential bug of ocl::CannyBuf. X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~3919^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f328d8388980604330f0ea1d28ae5734983d648;p=platform%2Fupstream%2Fopencv.git Fix a potential bug of ocl::CannyBuf. The program would crash if release is called twice. --- diff --git a/modules/ocl/src/canny.cpp b/modules/ocl/src/canny.cpp index 4219af1..e06d299 100644 --- a/modules/ocl/src/canny.cpp +++ b/modules/ocl/src/canny.cpp @@ -112,7 +112,11 @@ void cv::ocl::CannyBuf::release() mapBuf.release(); trackBuf1.release(); trackBuf2.release(); - openCLFree(counter); + if(counter) + { + openCLFree(counter); + counter = NULL; + } } namespace cv