From 08062e3fc3b01a37c3f1f5c65c538ef3d58999ef Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 22 May 2020 22:02:44 +1000 Subject: [PATCH] [client] check for underflow when checking frame time --- VERSION | 2 +- client/src/main.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index f0c899ed..62aa4286 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -B2-rc1-7-gf5da432d38+1 \ No newline at end of file +B2-rc1-8-g4441427943+1 \ No newline at end of file diff --git a/client/src/main.c b/client/src/main.c index c73d271a..c9624752 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -168,7 +168,8 @@ static int renderThread(void * unused) struct timespec end, diff; clock_gettime(CLOCK_REALTIME, &end); tsDiff(&diff, &time, &end); - if (diff.tv_sec > 0 || diff.tv_nsec > 1000000000) // 100ms + if (diff.tv_sec > 0 || diff.tv_nsec > 1000000000 || // 100ms + diff.tv_sec < 0 || diff.tv_nsec < 0) // underflow clock_gettime(CLOCK_REALTIME, &time); } }