From c56e9e05abb5ddf612bf5404e1d7b2dab4bad6de Mon Sep 17 00:00:00 2001 From: Ramiro Polla Date: Sat, 22 May 2010 21:32:57 +0000 Subject: Open 2-pass logfile in binary mode for both reading and writing. This fixes a regression on Windows introduced by r22769 in which the data read from the file was not properly zero terminated. The file was read as text, which caused the \r characters to be suppressed. Since the zero termination happens at the end of the buffer, and there was one byte less read per line, this caused the remaining space on the buffer to contain random data. Originally committed as revision 23251 to svn://svn.ffmpeg.org/ffmpeg/trunk --- ffmpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ffmpeg.c') diff --git a/ffmpeg.c b/ffmpeg.c index 5889a05ef4..63f0e6bfa2 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -2291,7 +2291,7 @@ static int av_transcode(AVFormatContext **output_files, pass_logfilename_prefix ? pass_logfilename_prefix : DEFAULT_PASS_LOGFILENAME_PREFIX, i); if (codec->flags & CODEC_FLAG_PASS1) { - f = fopen(logfilename, "w"); + f = fopen(logfilename, "wb"); if (!f) { fprintf(stderr, "Cannot write log file '%s' for pass-1 encoding: %s\n", logfilename, strerror(errno)); av_exit(1); -- cgit v1.2.3