[Mplayer-cvslog] CVS: main/input input.c,1.97,1.98

Sascha Sommer CVS syncmail at mplayerhq.hu
Wed Sep 15 16:08:48 CEST 2004


CVS change done by Sascha Sommer CVS

Update of /cvsroot/mplayer/main/input
In directory mail:/var2/tmp/cvs-serv32146/input

Modified Files:
	input.c 
Log Message:
fix a memory corruption and make sure only getch2 handles stdin
in order to avoid delayed events caused by lost input
patch by Mikulas Patocka <mikulas at artax.karlin.mff.cuni.cz>


Index: input.c
===================================================================
RCS file: /cvsroot/mplayer/main/input/input.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -r1.97 -r1.98
--- input.c	15 Sep 2004 09:45:34 -0000	1.97
+++ input.c	15 Sep 2004 14:08:46 -0000	1.98
@@ -661,7 +661,7 @@
   unsigned int l;
   l = 0;
   while(l < sizeof(int)) {
-    r = read(fd,(&code)+l,sizeof(int)-l);
+    r = read(fd,((char *)&code)+l,sizeof(int)-l);
     if(r <= 0)
       break;
     l +=r;
@@ -907,7 +907,7 @@
     }
 #ifndef HAVE_NO_POSIX_SELECT
     // No input from this fd
-    if(! (key_fds[i].flags & MP_FD_NO_SELECT) && ! FD_ISSET(key_fds[i].fd,&fds))
+    if(! (key_fds[i].flags & MP_FD_NO_SELECT) && ! FD_ISSET(key_fds[i].fd,&fds) && key_fds[i].fd != 0)
       continue;
 #endif
     if(key_fds[i].fd == 0) { // stdin is handled by getch2




More information about the MPlayer-cvslog mailing list