diff --git a/base/properties.cpp b/base/properties.cpp index cde4d69e3..ca8e96fc4 100644 --- a/base/properties.cpp +++ b/base/properties.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -109,7 +110,7 @@ static void WaitForPropertyCallback(void* data_ptr, const char*, const char* val static void DurationToTimeSpec(timespec& ts, const std::chrono::milliseconds d) { auto s = std::chrono::duration_cast(d); auto ns = std::chrono::duration_cast(d - s); - ts.tv_sec = s.count(); + ts.tv_sec = std::min(s.count(), std::numeric_limits::max()); ts.tv_nsec = ns.count(); }