fix for Bug #3085:
fix for Bug #3085:

weights array is only allocated for (l_count+1) elements,
but then weights[l_count+1] element is accessed.
apavlenko/opencv,opencv/opencv,apavlenko/opencv,opencv/opencv,opencv/opencv,apavlenko/opencv,opencv/opencv,apavlenko/opencv,opencv/opencv,apavlenko/opencv,opencv/opencv,apavlenko/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv