shithub: sox

Download patch

ref: a188768fb3df7ca7cce2c0abaa58ff945cdf4ea4
parent: 76caa137725af8725d869657b9c91f7a1523ea0e
author: cbagwell <cbagwell>
date: Tue Dec 7 15:13:51 EST 1999

Fixed array overrun bug in echos.c, thanks to Zinx Verituse.

--- a/src/echos.c
+++ b/src/echos.c
@@ -131,8 +131,8 @@
 	}
 	if (! (echos->delay_buf = (double *) malloc(sizeof (double) * echos->sumsamples)))
 		fail("echos: Cannot malloc %d bytes!\n", 
-			sizeof(long) * echos->sumsamples);
-	for ( j = 0; j < echos->samples[i]; ++j )
+			sizeof(double) * echos->sumsamples);
+	for ( j = 0; j < echos->sumsamples; ++j )
 		echos->delay_buf[j] = 0.0;
 	/* Be nice and check the hint with warning, if... */
 	sum_in_volume = 1.0;