dorian3d / DBoW2

Enhanced hierarchical bag-of-word library for C++
Other
860 stars 368 forks source link

Fix rare segfault #14

Closed felixendres closed 8 years ago

felixendres commented 8 years ago

In k means, If a cluster is empty FORB::meanValue() will call relase() on the cv::Mat/TDescriptor parameter (i.e. clusters[c]). This will lead to a segfault in FORB::distance(). Therefore, if the cv::Mat is empty after meanValue(), it needs to be erased from the clusters vector before proceeding.

dorian3d commented 8 years ago

Thanks!