From 03bccb3e4d7d53f6d83c3ad942760321822a8166 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <rem@videolan.org>
Date: Sat, 25 Nov 2006 15:42:36 +0000
Subject: [PATCH] Fix very unlikely race condition

---
 src/misc/mtime.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/misc/mtime.c b/src/misc/mtime.c
index 9dabb402617e..b32551faf716 100644
--- a/src/misc/mtime.c
+++ b/src/misc/mtime.c
@@ -156,10 +156,11 @@ mtime_t mdate( void )
          * the RTC rather than the TSC.  If it's anything else, we
          * presume that the performance counter is unreliable.
          */
+        LARGE_INTEGER buf;
 
-        freq = ( QueryPerformanceFrequency( (LARGE_INTEGER *)&freq ) &&
+        freq = ( QueryPerformanceFrequency( &buf ) &&
                  (freq == I64C(1193182) || freq == I64C(3579545) ) )
-               ? freq : 0;
+               ? buf : 0;
     }
 
     if( freq != 0 )
-- 
GitLab