shithub: sox

Download patch

ref: 6675b13822f18c2cd195843a8db662465a7dea4f
parent: 0dc533594b4286b2cf2c878d13b25278a76f041a
author: cbagwell <cbagwell>
date: Tue Sep 7 19:16:16 EDT 2004

segfault fix in resample for 64-bit processors.

--- a/Changelog
+++ b/Changelog
@@ -21,6 +21,8 @@
     alone from the rest of the sox package.
   o Benedikt Zeyen found a bug in synth effect when generating
     brown noise that could cause clipping.
+  o David Leverton sent another patch to prevent crashes on
+    amd64's when resampling.
 
 sox-12.17.5
 -----------
--- a/src/resample.c
+++ b/src/resample.c
@@ -516,9 +516,9 @@
       Xp = r->X + (long)time;      /* Ptr to current input sample */
 
       /* Past  inner product: */
-      v = (*prodUD)(r->Imp, Xp, -1, T, r->dhb, r->Xh); /* needs Np*Nmult in 31 bits */
+      v = (*prodUD)(r->Imp, Xp, -1L, T, r->dhb, r->Xh); /* needs Np*Nmult in 31 bits */
       /* Future inner product: */
-      v += (*prodUD)(r->Imp, Xp+1, 1, (1.0-T), r->dhb, r->Xh); /* prefer even total */
+      v += (*prodUD)(r->Imp, Xp+1, 1L, (1.0-T), r->dhb, r->Xh); /* prefer even total */
 
       if (Factor < 1) v *= Factor;
       *Y++ = v;              /* Deposit output */