[Asterisk-cvs] asterisk frame.c,1.66,1.67

kpfleming kpfleming
Fri Oct 28 17:43:20 CDT 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv2563

Modified Files:
	frame.c 
Log Message:
ensure that SLINEAR volume adjustments don't wrap around short integer maximums


Index: frame.c
===================================================================
RCS file: /usr/cvsroot/asterisk/frame.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- frame.c	28 Oct 2005 16:20:44 -0000	1.66
+++ frame.c	28 Oct 2005 21:35:55 -0000	1.67
@@ -1263,9 +1263,9 @@
 
 	for (count = 0; count < f->samples; count++) {
 		if (adjustment > 0) {
-			fdata[count] *= abs(adjustment);
+			ast_slinear_saturated_multiply(&fdata[count], abs(adjustment));
 		} else if (adjustment < 0) {
-			fdata[count] /= abs(adjustment);
+			ast_slinear_saturated_divide(&fdata[count], abs(adjustment));
 		}
 	}
 




More information about the svn-commits mailing list