shithub: sox

Download patch

ref: 5e70d7ddbc017f0be2e72f6a5f4bbff818ece8f9
parent: fddee7116afbb76f5d825e9609f45eaf4a9df708
author: cbagwell <cbagwell>
date: Sun Aug 24 17:27:39 EDT 2003

Fixed WAV memory leak.

--- a/Changelog
+++ b/Changelog
@@ -8,6 +8,9 @@
 -----------
   o Thomas Klausner sent in patches to compile audio drivers under
     NetBSD.
+  o Rahul Powar pointed out a memory leak in the WAV file handler.
+    It wasn't calling the correct close() function when closing
+    input files.
 
 sox-12.17.4
 -----------
--- a/src/handlers.c
+++ b/src/handlers.c
@@ -320,8 +320,8 @@
         st_ossdspstartwrite, st_rawwrite, st_rawstopwrite, st_format_nothing_seek},
 #endif
     {prcnames, ST_FILE_SEEK,
-	st_prcstartread, st_prcread, st_rawstopread,
-	st_prcstartwrite, st_prcwrite, st_prcstopwrite, st_prcseek},
+        st_prcstartread, st_prcread, st_rawstopread,
+        st_prcstartwrite, st_prcwrite, st_prcstopwrite, st_prcseek},
     {rawnames, ST_FILE_STEREO | ST_FILE_SEEK,
         st_rawstartread, st_rawread, st_rawstopread,
         st_rawstartwrite, st_rawwrite, st_rawstopwrite, st_rawseek},
@@ -377,7 +377,7 @@
         st_format_nothing_seek},
 #endif
     {wavnames, ST_FILE_STEREO | ST_FILE_SEEK,
-        st_wavstartread, st_wavread, st_format_nothing,
+        st_wavstartread, st_wavread, st_wavstopread,
         st_wavstartwrite, st_wavwrite, st_wavstopwrite, st_wavseek},
     {wvenames, ST_FILE_SEEK,
         st_wvestartread, st_wveread, st_rawstopread,
--- a/src/st_i.h
+++ b/src/st_i.h
@@ -345,6 +345,7 @@
 
 int st_wavstartread(ft_t ft);
 st_ssize_t st_wavread(ft_t ft, st_sample_t *buf, st_ssize_t len);
+int st_wavstopread(ft_t ft);
 int st_wavstartwrite(ft_t ft);
 st_ssize_t st_wavwrite(ft_t ft, st_sample_t *buf, st_ssize_t len);
 int st_wavstopwrite(ft_t ft);