Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03be7f5 commit 3bbeb7aCopy full SHA for 3bbeb7a
1 file changed
Modules/audioop.c
@@ -1039,8 +1039,13 @@ audioop_ratecv(self, args)
1039
cur_i[chan]));
1040
if (PyErr_Occurred())
1041
return NULL;
1042
- if (_PyString_Resize(&str,
1043
- ncp - PyString_AsString(str)) < 0)
+ len = ncp - PyString_AsString(str);
+ if (len == 0) {
1044
+ /*don't want to resize to zero length*/
1045
+ rv = PyString_FromStringAndSize("", 0);
1046
+ Py_DECREF(str);
1047
+ str = rv;
1048
+ } else if (_PyString_Resize(&str, len) < 0)
1049
1050
rv = Py_BuildValue("(O(iO))", str, d, samps);
1051
Py_DECREF(samps);
0 commit comments