summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ftnoir_tracker_udp/ftnoir_tracker_udp.cpp')
-rwxr-xr-x[-rw-r--r--]ftnoir_tracker_udp/ftnoir_tracker_udp.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp b/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp
index bc42f402..f03e75aa 100644..100755
--- a/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp
+++ b/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp
@@ -59,7 +59,10 @@ void FTNoIR_Tracker::data(double *data)
};
for (int i = 0; i < 3; i++)
- data[Yaw + i] += values[indices[i]];
+ {
+ int k = std::min<unsigned>(sizeof(values)/sizeof(values[0]), std::max(0, indices[i]));
+ data[Yaw + i] += values[k];
+ }
}