liuliu / ccv

C-based/Cached/Core Computer Vision Library, A Modern Computer Vision Library
http://libccv.org
Other
7.07k stars 1.71k forks source link

Infinite loop in ccv_bbf_detect_objects #152

Closed jpolsonaz closed 8 years ago

jpolsonaz commented 9 years ago

ccv_bbf_detect_objects gets in an infinite loop if a detection is at the far right or bottom of an image. Here's a patch which fixes the problem.

diff --git a/lib/ccv_bbf.c b/lib/ccv_bbf.c index 7c6754a..4f115da 100644 --- a/lib/ccv_bbf.c +++ b/lib/ccv_bbf.c @@ -209,7 +209,7 @@ static int _ccv_prepare_background_data(ccv_bbf_classifier_cascade_t* cascade, c break; } rect = (ccv_rect_t*)ccv_array_get(detected, r);

gpip commented 8 years ago

@jpolsonaz hey, not a ccv maintainer, but could you re-format your post using backticks so github doesn't interpret it as markdown? The bullet points in particular are confusing :)

liuliu commented 8 years ago

Thanks, I will look into this and fix all the places this may get wrong later today.

liuliu commented 8 years ago

https://github.com/liuliu/ccv/commit/1ea131e459193ffeafc4d12c05918f2ebc167c2f