From 04a8d348ea2892d1c4c636c1503c35b60a11a71b Mon Sep 17 00:00:00 2001 From: Shanigen Date: Mon, 23 Jul 2018 11:07:06 +0200 Subject: [PATCH] This commit should fix #5. --- src/kcf.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kcf.cpp b/src/kcf.cpp index 6ec4f48..8a80185 100644 --- a/src/kcf.cpp +++ b/src/kcf.cpp @@ -417,8 +417,8 @@ void KCF_Tracker::track(cv::Mat &img) if (m_visual_debug) { if (p_count%5 == 0) { - char scale[20]; - sprintf(scale, "%.5f", p_current_scale * p_scales[i]); + char scale[10]; + snprintf(scale, sizeof(scale), "%.5f", p_current_scale * p_scales[i]); cv::putText(p_debug_subwindows.back(), scale, cv::Point(0, 10), cv::FONT_HERSHEY_COMPLEX_SMALL, 0.5, cv::Scalar(0,255,0),1,cv::LINE_AA); } } @@ -450,8 +450,8 @@ void KCF_Tracker::track(cv::Mat &img) double weight = p_scales[i] < 1. ? p_scales[i] : 1./p_scales[i]; if (m_visual_debug){ - char scale[20]; - sprintf(scale, "%.5f", p_current_scale * p_scales[i]); + char scale[10]; + snprintf(scale, sizeof(scale), "%.5f", p_current_scale * p_scales[i]); std::string angle = std::to_string(p_current_angle + p_angles[j]); -- 2.39.2