summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-05-31 21:50:21 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-05-31 21:50:21 +0000
commitca9eeec2eb1cd93f54ae91b957e93e3247a97863 (patch)
treeaf38dd2700f042e9e8d655f049cffa4b5c4bf4f0 /mplayer.c
parent9157b3e1892747cd0023d9096aa986466d088c90 (diff)
downloadmpv-ca9eeec2eb1cd93f54ae91b957e93e3247a97863.tar.bz2
mpv-ca9eeec2eb1cd93f54ae91b957e93e3247a97863.tar.xz
check for -dumpstream file writes, patch by Eric Lammerts <eric@lammerts.org>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10226 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/mplayer.c b/mplayer.c
index 185b8547f1..b59623df28 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -1303,9 +1303,17 @@ if(stream_dump_type==5){
}
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);
}