webpmux: (windows) open stdout in binary mode

prevents corrupt output. related to issue #217

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

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) { static int WriteData(const char* filename, const WebPData* const webpdata) {
int ok = 0; int ok = 0;
FILE* fout = strcmp(filename, "-") ? fopen(filename, "wb") : stdout; FILE* fout = strcmp(filename, "-") ? fopen(filename, "wb")
if (!fout) { : ExUtilSetBinaryMode(stdout);
if (fout == NULL) {
fprintf(stderr, "Error opening output WebP file %s!\n", filename); fprintf(stderr, "Error opening output WebP file %s!\n", filename);
return 0; return 0;
} }