summaryrefslogtreecommitdiffstats
path: root/Modules/audioop.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/audioop.c')
-rw-r--r--Modules/audioop.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/Modules/audioop.c b/Modules/audioop.c
index 5c69258..7e40bbd 100644
--- a/Modules/audioop.c
+++ b/Modules/audioop.c
@@ -530,7 +530,6 @@ audioop_findfit(PyObject *self, PyObject *args)
best_result = result;
best_j = 0;
- j = 0;
for ( j=1; j<=len1-len2; j++) {
aj_m1 = (double)cp1[j-1];
@@ -616,7 +615,6 @@ audioop_findmax(PyObject *self, PyObject *args)
best_result = result;
best_j = 0;
- j = 0;
for ( j=1; j<=len1-len2; j++) {
aj_m1 = (double)cp1[j-1];
@@ -1103,8 +1101,7 @@ audioop_ratecv(PyObject *self, PyObject *args)
PyErr_SetString(AudioopError, "# of channels should be >= 1");
return NULL;
}
- bytes_per_frame = size * nchannels;
- if (bytes_per_frame / nchannels != size) {
+ if (size > INT_MAX / nchannels) {
/* This overflow test is rigorously correct because
both multiplicands are >= 1. Use the argument names
from the docs for the error msg. */
@@ -1112,6 +1109,7 @@ audioop_ratecv(PyObject *self, PyObject *args)
"width * nchannels too big for a C int");
return NULL;
}
+ bytes_per_frame = size * nchannels;
if (weightA < 1 || weightB < 0) {
PyErr_SetString(AudioopError,
"weightA should be >= 1, weightB should be >= 0");
@@ -1431,7 +1429,6 @@ audioop_lin2adpcm(PyObject *self, PyObject *args)
if ( state == Py_None ) {
/* First time, it seems. Set defaults */
valpred = 0;
- step = 7;
index = 0;
} else if ( !PyArg_ParseTuple(state, "ii", &valpred, &index) )
return 0;
@@ -1532,7 +1529,6 @@ audioop_adpcm2lin(PyObject *self, PyObject *args)
if ( state == Py_None ) {
/* First time, it seems. Set defaults */
valpred = 0;
- step = 7;
index = 0;
} else if ( !PyArg_ParseTuple(state, "ii", &valpred, &index) )
return 0;