mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-15 13:10:31 +01:00
util: Fix the integer addition in os_time_get_absolute_timeout()
This should fix glClientWaitSync() timing out too early with a INT64_MAX
timeout on radeonsi
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11615
Fixes: 7316cc92f3 ("gallium/os: add conversion and wait functions for absolute timeouts")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30476>
This commit is contained in:
parent
dafc4476f7
commit
e14d1f5bc0
1 changed files with 3 additions and 1 deletions
|
|
@ -97,7 +97,9 @@ os_time_get_absolute_timeout(uint64_t timeout)
|
|||
return OS_TIMEOUT_INFINITE;
|
||||
|
||||
time = os_time_get_nano();
|
||||
abs_timeout = time + (int64_t)timeout;
|
||||
|
||||
/* Do the addition in unsigned, because signed overflow is UB, then convert to signed again. */
|
||||
abs_timeout = (uint64_t)time + (uint64_t)timeout;
|
||||
|
||||
/* Check for overflow. */
|
||||
if (abs_timeout < time)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue