[Mplayer-cvslog] CVS: main mplayer.c,1.700,1.701

Alex Beregszaszi alex at mplayerhq.hu
Sat May 31 23:50:44 CEST 2003


Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv23084

Modified Files:
	mplayer.c 
Log Message:
check for -dumpstream file writes, patch by Eric Lammerts <eric at lammerts.org>

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.700
retrieving revision 1.701
diff -u -r1.700 -r1.701
--- mplayer.c	31 May 2003 20:52:16 -0000	1.700
+++ mplayer.c	31 May 2003 21:50:21 -0000	1.701
@@ -1303,9 +1303,17 @@
   }
   while(!stream->eof){
       len=stream_read(stream,buf,4096);
-      if(len>0) fwrite(buf,len,1,f);
+      if(len>0) {
+        if(fwrite(buf,len,1,f) != 1) {
+          mp_msg(MSGT_MENCODER,MSGL_FATAL,MSGTR_ErrorWritingFile,stream_dump_name);
+          exit_player(MSGTR_Exit_error);
+        }
+      }
+  }
+  if(fclose(f)) {
+    mp_msg(MSGT_MENCODER,MSGL_FATAL,MSGTR_ErrorWritingFile,stream_dump_name);
+    exit_player(MSGTR_Exit_error);
   }
-  fclose(f);
   mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_CoreDumped);
   exit_player_with_rc(MSGTR_Exit_eof, 0);
 }



More information about the MPlayer-cvslog mailing list