[vlc-devel] commit: Win32: fix unlikely Sleep() overflow ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Aug 9 18:29:56 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Wed Aug  6 23:05:53 2008 +0300| [1a0832b256f9ffcf9229ae6a3fc056848140a266] | committer: Rémi Denis-Courmont 

Win32: fix unlikely Sleep() overflow

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1a0832b256f9ffcf9229ae6a3fc056848140a266
---

 src/misc/mtime.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/misc/mtime.c b/src/misc/mtime.c
index d9af9fd..5ab08c5 100644
--- a/src/misc/mtime.c
+++ b/src/misc/mtime.c
@@ -373,7 +373,9 @@ void msleep( mtime_t delay )
     snooze( delay );
 
 #elif defined( WIN32 ) || defined( UNDER_CE )
-    Sleep( (DWORD) (delay / 1000) );
+    for (delay /= 1000; delay > 0x7fffffff; delay -= 0x7fffffff)
+        Sleep (0x7fffffff);
+    Sleep (delay);
 
 #elif defined( HAVE_NANOSLEEP )
     struct timespec ts_delay;




More information about the vlc-devel mailing list