shithub: sox

Download patch

ref: 96dab95356fe1b22d85e2e6e19d74b1a4d25ab9e
parent: dabfcd802e43e873e16e93321c158083704500da
author: cbagwell <cbagwell>
date: Sun Aug 18 15:11:01 EDT 2002

more bugfixes

--- a/src/adpcm.c
+++ b/src/adpcm.c
@@ -142,7 +142,7 @@
         {
                 int ch;
                 unsigned char b;
-                short *op, *top;
+                short *op, *top, *tmp;
 
                 /* already have 1st 2 samples from block-header */
                 op = obuff + 2*chans;
@@ -151,10 +151,12 @@
                 ch = 0;
                 while (op < top) {
                         b = *ip++;
-                        *op++ = AdpcmDecode(b >> 4, state+ch, op[-chans], op[-2*chans]);
+			tmp = op;
+                        *op++ = AdpcmDecode(b >> 4, state+ch, tmp[-chans], tmp[-2*chans]);
                         if (++ch == chans) ch = 0;
                         /* ch = ++ch % chans; */
-                        *op++ = AdpcmDecode(b&0x0f, state+ch, op[-chans], op[-2*chans]);
+			tmp = op;
+                        *op++ = AdpcmDecode(b&0x0f, state+ch, tmp[-chans], tmp[-2*chans]);
                         if (++ch == chans) ch = 0;
                         /* ch = ++ch % chans; */
                 }
--- a/src/prc.c
+++ b/src/prc.c
@@ -165,7 +165,6 @@
 
 int st_prcstopwrite(ft_t ft)
 {
-
         /* Call before seeking to flush buffer */
         st_rawstopwrite(ft);
 
@@ -181,6 +180,7 @@
                 return(ST_EOF);
         }
         prcwriteheader(ft);
+	return ST_SUCCESS;
 }
 
 static void prcwriteheader(ft_t ft)