From 8975d87f66e6af35a98e6166ad3f90259105ae1c Mon Sep 17 00:00:00 2001 From: Frank Richter Date: Mon, 14 Aug 2017 16:05:22 +0200 Subject: [PATCH] Check for negative delta in wait_swap_interval() --- src/gallium/state_trackers/wgl/stw_framebuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/wgl/stw_framebuffer.c b/src/gallium/state_trackers/wgl/stw_framebuffer.c index 321fbb6..1b95635 100644 --- a/src/gallium/state_trackers/wgl/stw_framebuffer.c +++ b/src/gallium/state_trackers/wgl/stw_framebuffer.c @@ -602,7 +602,7 @@ wait_swap_interval(struct stw_framebuffer *fb) 1.0e6 / stw_dev->refresh_rate * stw_dev->swap_interval; /* if time since last swap is less than wait period, wait */ - if (delta < min_swap_period) { + if ((delta >= 0) && (delta < min_swap_period)) { float fudge = 1.75f; /* emperical fudge factor */ int64_t wait = (min_swap_period - delta) * fudge; os_time_sleep(wait); -- 2.11.1.windows.1