From 0a1e6abc7cb9cad5aee91e2e8cdbb1a2da395e48 Mon Sep 17 00:00:00 2001 From: Ambuj-Choudha Date: Thu, 6 Aug 2026 15:30:05 +0200 Subject: [PATCH 1/2] Reorder parameters in calcCostMatrix function for consistency --- include/ByteTrack/BYTETracker.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ByteTrack/BYTETracker.h b/include/ByteTrack/BYTETracker.h index b9769e2..72f8a02 100644 --- a/include/ByteTrack/BYTETracker.h +++ b/include/ByteTrack/BYTETracker.h @@ -43,8 +43,8 @@ class BYTETracker const int &cost_matrix_size_size, const float &thresh, std::vector> &matches, - std::vector &b_unmatched, - std::vector &a_unmatched) const; + std::vector &a_unmatched, + std::vector &b_unmatched) const; std::vector> calcIouDistance(const std::vector &a_tracks, const std::vector &b_tracks) const; From a46c003bb3514c7ae00cdfe7357bdd9773534ed0 Mon Sep 17 00:00:00 2001 From: Ambuj-Choudha Date: Thu, 6 Aug 2026 15:33:10 +0200 Subject: [PATCH 2/2] Fix memory allocation in execLapjv function for cost_ptr, x_c, and y_c --- src/BYTETracker.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/BYTETracker.cpp b/src/BYTETracker.cpp index a02abc1..ebbcadc 100644 --- a/src/BYTETracker.cpp +++ b/src/BYTETracker.cpp @@ -515,9 +515,9 @@ double byte_track::BYTETracker::execLapjv(const std::vector> } double **cost_ptr; - cost_ptr = new double *[sizeof(double *) * n]; + cost_ptr = new double *[n]; for (int i = 0; i < n; i++) - cost_ptr[i] = new double[sizeof(double) * n]; + cost_ptr[i] = new double[n]; for (int i = 0; i < n; i++) { @@ -527,8 +527,8 @@ double byte_track::BYTETracker::execLapjv(const std::vector> } } - int* x_c = new int[sizeof(int) * n]; - int *y_c = new int[sizeof(int) * n]; + int* x_c = new int[n]; + int *y_c = new int[n]; int ret = lapjv_internal(n, cost_ptr, x_c, y_c); if (ret != 0)