# HG changeset patch # User alex # Date 1054417821 0 # Node ID 785c945f67965591e68cd1f2eb89c18c808fad14 # Parent 418da3547f85367e6489d65c390622ef1fb3c5fc check for -dumpstream file writes, patch by Eric Lammerts diff -r 418da3547f85 -r 785c945f6796 mplayer.c --- a/mplayer.c Sat May 31 21:31:23 2003 +0000 +++ b/mplayer.c Sat May 31 21:50:21 2003 +0000 @@ -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); + } + } } - fclose(f); + if(fclose(f)) { + mp_msg(MSGT_MENCODER,MSGL_FATAL,MSGTR_ErrorWritingFile,stream_dump_name); + exit_player(MSGTR_Exit_error); + } mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_CoreDumped); exit_player_with_rc(MSGTR_Exit_eof, 0); }