diff -u -r1.96 sox.c --- src/sox.c 20 Mar 2006 02:37:10 -0000 1.96 +++ src/sox.c 17 Apr 2006 16:45:02 -0000 @@ -1121,7 +1121,7 @@ &efftab[neffects-1].obuf[total], (st_ssize_t)efftab[neffects-1].olen-total); - if (len < 0) + if (len < 0 || file_desc[file_count-1]->file.eof) { st_warn("Error writing: %s", file_desc[file_count-1]->st_errstr); diff -u -r1.74 st.h --- src/st.h 20 Mar 2006 03:25:12 -0000 1.74 +++ src/st.h 17 Apr 2006 16:45:02 -0000 @@ -20,7 +20,7 @@ #include "ststdint.h" /* Release 12.18.1 of libst */ -#define ST_LIB_VERSION_CODE 0x0c1109 +#define ST_LIB_VERSION_CODE 0x0c1201 #define ST_LIB_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) typedef int32_t st_sample_t; diff -u -r1.7 stio.c --- src/stio.c 21 Feb 2006 03:06:54 -0000 1.7 +++ src/stio.c 17 Apr 2006 16:45:02 -0000 @@ -246,6 +246,7 @@ */ if (!strcmp(ft->filename, "-")) { + SET_BINARY_MODE(stdout); ft->fp = stdout; } diff -u -r1.20 vorbis.c --- src/vorbis.c 1 Oct 2005 20:02:03 -0000 1.20 +++ src/vorbis.c 17 Apr 2006 16:45:03 -0000 @@ -26,6 +26,9 @@ #include #include +#include +#include + #include #include #include @@ -73,7 +76,12 @@ /* Taken from vorbisfile.c in libvorbis source code */ static int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence){ - if(f==NULL)return(-1); + int filetype; + struct _stat st; + _fstat(f, &st); + filetype = st.st_mode & _S_IFMT; + + if ((f==NULL) || !(filetype == _S_IFREG)) return(-1); return fseek(f,(int)off,whence); }