--- /dev/null
+--- examples/sndfile-to-text.c-dist 2009-02-09 12:36:49.000000000 +0100
++++ examples/sndfile-to-text.c 2009-02-09 12:37:05.000000000 +0100
+@@ -101,6 +101,7 @@ main (int argc, char * argv [])
+ return 1 ;
+ } ;
+
++ memset(&sfinfo, 0, sizeof(sfinfo));
+ if ((infile = sf_open (infilename, SFM_READ, &sfinfo)) == NULL)
+ { printf ("Not able to open input file %s.\n", infilename) ;
+ puts (sf_strerror (NULL)) ;
+--- examples/sfprocess.c-dist 2009-02-07 05:07:34.000000000 +0100
++++ examples/sfprocess.c 2009-02-09 12:36:23.000000000 +0100
+@@ -31,6 +31,7 @@
+ */
+
+ #include <stdio.h>
++#include <string.h>
+
+ /* Include this header file to use functions from libsndfile. */
+ #include <sndfile.h>
+@@ -83,6 +84,7 @@ main (void)
+ ** sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_16 ;
+ ** sfinfo.channels = 2 ;
+ */
++ memset(&sfinfo, 0, sizeof(sfinfo));
+ if (! (infile = sf_open (infilename, SFM_READ, &sfinfo)))
+ { /* Open failed so print an error message. */
+ printf ("Not able to open input file %s.\n", infilename) ;
+--- examples/generate.c-dist 2009-02-07 05:07:44.000000000 +0100
++++ examples/generate.c 2009-02-09 12:36:23.000000000 +0100
+@@ -98,6 +98,7 @@ encode_file (const char *infilename, con
+ k = 16 - strlen (outfilename) ;
+ PUT_DOTS (k) ;
+
++ memset(&sfinfo, 0, sizeof(sfinfo));
+ if (! (infile = sf_open (infilename, SFM_READ, &sfinfo)))
+ { printf ("Error : could not open file : %s\n", infilename) ;
+ puts (sf_strerror (NULL)) ;
--- /dev/null
+=== modified file 'src/paf.c'
+---
+ src/paf.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/paf.c
++++ b/src/paf.c
+@@ -202,7 +202,7 @@
+ psf->endian = SF_ENDIAN_BIG ;
+ } ;
+
+- if (paf_fmt.channels > SF_MAX_CHANNELS)
++ if (paf_fmt.channels > SF_MAX_CHANNELS || paf_fmt.channels <= 0)
+ return SFE_PAF_BAD_CHANNELS ;
+
+ psf->datalength = psf->filelength - psf->dataoffset ;
--- /dev/null
+--- configure.ac.orig
++++ configure.ac
+@@ -23,7 +23,9 @@ AC_SUBST(ACLOCAL_AMFLAGS, "-I M4")
+
+ AC_LANG([C])
+
+-AC_PROG_CC
++AC_PROG_CC_STDC
++AC_USE_SYSTEM_EXTENSIONS
++AC_SYS_LARGEFILE
+ AM_PROG_CC_C_O
+ AC_PROG_CXX
+ AC_PROG_SED
+--- src/file_io.c.orig
++++ src/file_io.c
+@@ -564,6 +564,9 @@ psf_open_fd (PSF_FILE * pfile)
+ return - SFE_BAD_OPEN_MODE ;
+ break ;
+ } ;
++#ifdef O_CLOEXEC
++ oflag |= O_CLOEXEC;
++#endif
+
+ if (mode == 0)
+ fd = open (pfile->path.c, oflag) ;
+--- Makefile.am.orig
++++ Makefile.am
+@@ -1,5 +1,6 @@
+ ## Process this file with automake to produce Makefile.in
+
++ACLOCAL_AMFLAGS = -I M4
+ DISTCHECK_CONFIGURE_FLAGS = --enable-gcc-werror
+
+ if BUILD_OCTAVE_MOD