From 417121f9adc7cd18eef77e92499c032842b034fa Mon Sep 17 00:00:00 2001 From: WesselVS Date: Tue, 5 Nov 2024 09:36:51 +0100 Subject: [PATCH] do not segfault on empty xdf (with clock sync values) (#42) --- xdf.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xdf.cpp b/xdf.cpp index 67f86fc..1891640 100644 --- a/xdf.cpp +++ b/xdf.cpp @@ -612,8 +612,10 @@ void Xdf::syncTimeStamps() } else { - streams[k].info.first_timestamp = streams[k].time_stamps.front(); - streams[k].info.last_timestamp = streams[k].time_stamps.back(); + if (streams[k].time_stamps.size() > 0) { + streams[k].info.first_timestamp = streams[k].time_stamps.front(); + streams[k].info.last_timestamp = streams[k].time_stamps.back(); + } } } }