shithub: sox

Download patch

ref: d4c13edb5b6586934693e1bb11502ac88862c894
parent: 2a660d929f489676d53a7c3d75daccebba2dc96c
author: robs <robs>
date: Thu Apr 23 00:48:53 EDT 2009

Fix [2779041] spectrogram PNG file is invalid on Windows

--- a/ChangeLog
+++ b/ChangeLog
@@ -96,6 +96,7 @@
   o Fix [2332343] 'silence' segfault with certain lengths. (cbagwell)
   o Fix temporary file problems in Windows (cygwin) with normalise and
     other effects.  (robs)
+  o Fix [2779041] spectrogram PNG file is invalid on Windows.  (robs)
   o Parallel effects channel processing on some hyper-threading/mult-core
     architectures.  New `--single-threaded' option to disable this.  (robs)
 
--- a/NEWS
+++ b/NEWS
@@ -22,7 +22,7 @@
   o Can now auto-detect file-type even when inputing from a pipe.
 
 For the complete list of changes, see the ChangeLog at
-  http://sox.cvs.sourceforge.net/sox/sox/ChangeLog?revision=1.223&view=markup
+  http://sox.cvs.sourceforge.net/sox/sox/ChangeLog?revision=1.224&view=markup
 
 Thanks to all who contributed to this release.
 
--- a/src/spectrogram.c
+++ b/src/spectrogram.c
@@ -385,7 +385,7 @@
 static int stop(sox_effect_t * effp)
 {
   priv_t *    p        = (priv_t *) effp->priv;
-  FILE *      file     = fopen(p->out_name, "w");
+  FILE *      file     = fopen(p->out_name, "wb");
   uLong       font_len = 96 * font_y;
   int         rows     = below + p->rows + 30 + 20 * !!p->title;
   int         cols     = left + p->cols + between + spectrum_width + right;