webpmux: (windows) open stdout in binary mode

prevents corrupt output. related to issue #217

(cherry picked from commit e80eab1fbc63fa267f7e97a89c6d5d07b9981d45)

Change-Id: I6f0dac8131127717ba72b0709fb35d421ab41acb
This commit is contained in:
James Zern 2014-08-29 19:11:41 -07:00
parent d40e885931
commit 4206ac6bbf

View File

@ -402,8 +402,9 @@ static int CreateMux(const char* const filename, WebPMux** mux) {
static int WriteData(const char* filename, const WebPData* const webpdata) {
int ok = 0;
FILE* fout = strcmp(filename, "-") ? fopen(filename, "wb") : stdout;
if (!fout) {
FILE* fout = strcmp(filename, "-") ? fopen(filename, "wb")
: ExUtilSetBinaryMode(stdout);
if (fout == NULL) {
fprintf(stderr, "Error opening output WebP file %s!\n", filename);
return 0;
}