CihanTopal / ED_Lib

Implementations of edge (ED, EDColor, EDPF), line (EDLines), circle and low eccentric ellipse (EDCircles) detection algorithms.
MIT License
396 stars 145 forks source link

fix delete array to avoid corrupted double-linked list error #16

Closed AkiraShibata18 closed 3 years ago

AkiraShibata18 commented 3 years ago

corrupted double-linked list error occurred when EDCircles is used for streaming image data. I built EDCirles using CMake, so to analyze this error, AddressSanitizer was used by adding set parameter in CMakeLists.txt like below.

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")

According to AddressSanitizer, delete p (pointer of array) in source code should be delete[] p.

All corresponding parts in both EDCircles.cpp and EDCircles.h are fixed.

CihanTopal commented 3 years ago

Hi AkiraShibata,

Did you test this update only on CMake on Linux? Have you had any test on Visual Studio as well?

Thanks, Cihan

AkiraShibata18 commented 3 years ago

Hi Cihan,

Thank you for your reply. Yes, I checked only on CMake on Ubuntu18.04. This change is for basic matter in C++, so I feel there are no bad influence on the other environment. But If I should check on Visual Studio on Windows, I will try.

Regards, Akira

sturkmen72 commented 3 years ago

i have a PR to merge some ED_Lib functionality into OpenCV and already made same changes in my PR.

any help ( testing, giving ideas etc.) about the PR will be appreciated.