DM: "wb" (binary mode) may matter on Windows
authormtklein <mtklein@chromium.org>
Tue, 25 Aug 2015 17:56:08 +0000 (10:56 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 25 Aug 2015 17:56:08 +0000 (10:56 -0700)
I suspect we might be doing some funky /n -> /r/n translations without 'b'.
This kills the PNG.

BUG=skia:

NOTREECHECKS=true

Review URL: https://codereview.chromium.org/1303063008

dm/DM.cpp

index b93f9d8..870b97a 100644 (file)
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -495,7 +495,7 @@ static bool dump_png(SkBitmap bitmap, const char* path, const char* md5) {
     // We don't need bitmap anymore.  Might as well drop our ref.
     bitmap.reset();
 
-    FILE* f = fopen(path, "w");
+    FILE* f = fopen(path, "wb");
     if (!f) { return false; }
 
     png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);