From efe80d1f65bc596d0932bcf74b78dfa28343156b Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 24 Nov 2015 21:41:08 +0100 Subject: [PATCH] mm_io_c: open MODE_CREATE files for reading and writing on Windows, too mkvmerge's output file is opened in MODE_CREATE. This mode is supposed to create the file if it doesn't exist, to truncate it otherwise and to open it for writing. The fix for #1498 requires reading from the file, too, and therefore the file must be opened for reading, too. On non-Windows systems MODE_CREATE was already translated into opening for reading and writing. --- src/common/mm_io_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/mm_io_win.cpp b/src/common/mm_io_win.cpp index 45396c218..d6c3eacff 100644 --- a/src/common/mm_io_win.cpp +++ b/src/common/mm_io_win.cpp @@ -59,7 +59,7 @@ mm_file_io_c::mm_file_io_c(const std::string &path, disposition = OPEN_ALWAYS; break; case MODE_CREATE: - access_mode = GENERIC_WRITE; + access_mode = GENERIC_WRITE | GENERIC_READ; share_mode = FILE_SHARE_READ; disposition = CREATE_ALWAYS; break;