From 8b5c92f0e85acbe407799e7e6589679ebc88c8bb Mon Sep 17 00:00:00 2001 From: WesselVS Date: Tue, 5 Nov 2024 09:24:24 +0100 Subject: [PATCH] do not segfault on empty xdf (with clock sync values) --- 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(); + } } } }