summaryrefslogtreecommitdiffstats
path: root/Modules/audioop.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-19418: audioop.c: Fix warnings on -0x80000000 (GH-7453)Victor Stinner2018-06-061-2/+5
| | | | | | | | bpo-19418, bpo-33781: Fix the following warnings on Windows: Modules\audioop.c(28): warning C4146: unary minus operator applied to unsigned type, result still unsigned Modules\audioop.c(396): warning C4146: unary minus operator applied to unsigned type, result still unsigned
* bpo-33781: audioop: enhance rounding double as int (GH-7447) (GH-7452)Victor Stinner2018-06-061-12/+19
| | | | | | | | Move the floor() call into fbound() to call floor() on a double rather than an int. The change should enhance the rounding. Document also (int)double rounding mode. (cherry picked from commit 45e4efba7fa2abe61d25e4f8b5bf482e19ff1280)
* [2.7] bpo-28261: Prevent raising SystemError where PyArg_ParseTuple is used ↵Oren Milman2017-08-261-2/+12
| | | | to parse non-args. (#3213)
* Issue #25523: Correct "a" article to "an" articleMartin Panter2015-11-021-1/+1
| | | | | | This changes the main documentation, doc strings, source code comments, and a couple error messages in the test suite. In some cases the word was removed to fix the grammar.
* Corrections for a/an in code comments and documentationMartin Panter2016-05-081-3/+3
|
* Issue #24456: Fixed possible buffer over-read in adpcm2lin() and lin2adpcm()Serhiy Storchaka2015-06-281-8/+30
| | | | | functions of the audioop module. Fixed SystemError when the state is not a tuple. Fixed possible memory leak.
* Issue #24326: Fixed audioop.ratecv() with non-default weightB argument.Serhiy Storchaka2015-05-291-1/+1
| | | | Original patch by David Moore.
* Issue #16686: Fixed a lot of bugs in audioop module.Serhiy Storchaka2013-02-091-154/+166
| | | | | | | | | | | | * avgpp() and maxpp() no more crash on empty and 1-samples input fragment. They now work when peak-peak values are greater INT_MAX. * ratecv() no more crashes on empty input fragment. * Fixed an integer overflow in ratecv(). * Fixed an integer overflow in add() and bias() for 32-bit samples. * reverse(), lin2lin() and ratecv() no more lose precision for 32-bit samples. * max() and rms() no more returns negative result for 32-bit sample -0x80000000. * minmax() now returns correct max value for 32-bit sample -0x80000000. * avg(), mul(), tomono() and tostereo() now round negative result down and can return 32-bit sample -0x80000000. * add() now can return 32-bit sample -0x80000000.
* Issue #13806: The size check in audioop decompression functions was too ↵Antoine Pitrou2012-01-281-3/+3
| | | | | | strict and could reject valid compressed data. Patch by Oleg Plakhotnyuk.
* Issue #7673: Fix security vulnerability (CVE-2010-2089) in the audioop module,Victor Stinner2010-07-031-73/+71
| | | | ensure that the input string length is a multiple of the frame size
* Issue #8674: fix another bogus overflow check in audioop module.Mark Dickinson2010-05-111-17/+8
|
* Issue #8674: Fix incorrect and UB-inducing overflow checks in audioopMark Dickinson2010-05-101-28/+21
| | | | module. Thanks Tomas Hoger for the patch.
* Untabify C files. Will watch buildbots.Antoine Pitrou2010-05-091-1226/+1226
|
* Clean up whitespace and remove unneeded variable initialization as found byBrett Cannon2010-05-031-56/+52
| | | | Clang.
* Fix signed/unsigned compiler warning.Raymond Hettinger2009-06-101-1/+1
|
* Issue 3306. Better control for a lenght in findmax() function.Facundo Batista2008-07-071-1/+1
|
* Merge in release25-maint r60793:Gregory P. Smith2008-06-111-15/+53
| | | | | | Added checks for integer overflows, contributed by Google. Some are only available if asserts are left in the code, in cases where they can't be triggered from Python code.
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-32/+32
| | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-32/+32
|
* Fix various minor errors in passing arguments toMartin v. Löwis2006-10-191-3/+8
| | | | PyArg_ParseTuple.
* Convert audioop over to METH_VARARGS.Georg Brandl2006-05-281-60/+66
|
* Make some functions static, reformat function decl to be consistent and ↵Neal Norwitz2006-03-201-7/+10
| | | | check for error from PyModule_GetDict()
* replace use of int16_t with a (typedef'd) short, to fix Windows buildbots.Anthony Baxter2006-03-201-1199/+1201
| | | | expand tabs.
* SF [ 1231053 ] audioop - alaw encoding/decoding added, code updatedAnthony Baxter2006-03-201-91/+305
| | | | | | | | | This patch adds a-LAW encoding to audioop and replaces the old u-LAW encoding/decoding code with the current code from sox. Possible issues: the code from sox uses int16_t. Code by Lars Immisch
* Thanks to Coverity, these were all reported by their Prevent tool.Neal Norwitz2006-03-071-0/+2
| | | | | All of these (except _lsprof.c) should be backported. Particularly the hotshot change which validates sys.path. Can someone backport?
* Merge ssize_t branch.Martin v. Löwis2006-02-151-1/+3
|
* Check return result from Py_InitModule*(). This API can fail.Neal Norwitz2006-01-191-0/+2
| | | | Probably should be backported.
* Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototypeMark Hammond2002-08-021-1/+1
| | | | | | for Py_Main(). Thanks to Kalle Svensson and Skip Montanaro for the patches.
* Patch #477750: Use METH_ constants in Modules.Martin v. Löwis2002-01-171-23/+23
|
* audioop_ratecv() again: settle for a sloppier upper bound that's lessTim Peters2001-12-071-34/+19
| | | | obnoxious to compute and easier to explain. No compromise on safety.
* audioop_ratecv(): I left a potentially unsafe multiply uncheckedTim Peters2001-12-051-15/+15
| | | | | yesterday -- repair that. Also renamed the silly size_times_nchannels to bytes_per_frame.
* SF bug 482574: audioop.ratecv crashes.Tim Peters2001-12-051-6/+62
| | | | | | | | | | | | Bugfix candidate. A numerically naive computation of output buffer size caused crashes and spurious MemoryErrors for reasonable arguments. audioop_ratecv(): Avoid spurious overflow by careful reworking of the buffer size computations, triggering MemoryError if and only if the final buffer size can't be represented in a C int (although PyString_FromStringAndSize may legitimately raise MemoryError even if it does fit in a C int). All reasonable arguments should work as intended now, and all unreasonable arguments should be cuaght.
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* Remove one compiler warning found with -Wstrict-prototypes.Fred Drake2000-08-311-1/+1
|
* Removing warnings discovered by gcc -WallMoshe Zadka2000-08-041-1/+1
|
* merge Include/my*.h into Include/pyport.hPeter Schneider-Kamp2000-07-311-2/+0
| | | | marked my*.h as obsolete
* Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',Thomas Wouters2000-07-211-7/+3
| | | | | | | | | | | | | | | | | | and a couple of functions that were missed in the previous batches. Not terribly tested, but very carefully scrutinized, three times. All these were found by the little findkrc.py that I posted to python-dev, which means there might be more lurking. Cases such as this: long func(a, b) long a; long b; /* flagword */ { and other cases where the last ; in the argument list isn't followed by a newline and an opening curly bracket. Regexps to catch all are welcome, of course ;)
* ANSI-ficationPeter Schneider-Kamp2000-07-101-72/+24
|
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Disable the ZEROTRAP code -- this turns a 0 byte into a 2 byte and IGuido van Rossum2000-05-021-1/+1
| | | | | don't think that's what we want. There was some brief discussion of this somewhere but I don't recall where.
* Massive patch by Skip Montanaro to add ":name" to as manyGuido van Rossum2000-02-291-2/+2
| | | | PyArg_ParseTuple() format string arguments as possible.
* Fixed memory leak in ratecv, in response to PR#72. By Sjoerd Mullender.Guido van Rossum1999-09-071-8/+18
|
* Add DL_EXPORT() to all modules that could possibly be usedGuido van Rossum1998-12-041-1/+1
| | | | on BeOS or Windows.
* Purported fixes for 64-bit platforms with help from John JorgensenGuido van Rossum1998-04-231-12/+24
|
* Add cast to realloc/malloc call to shut up AIX compiler. (Vladimir Marangozov)Guido van Rossum1997-10-311-2/+2
|
* Apply two changes, systematically:Guido van Rossum1997-10-011-4/+3
| | | | | | | | | | | | | | | | | (1) Use PyErr_NewException("module.class", NULL, NULL) to create the exception object. (2) Remove all calls to Py_FatalError(); instead, return or ignore the errors -- the import code now checks PyErr_Occurred() after calling a module's init function, so it's no longer a fatal error for the initialization to fail. Also did some small cleanups, e.g. removed unnecessary test for "already initialized" from initfpectl(), and unified initposix()/initnt(). I haven't checked this very thoroughly, so while the changes are pretty trivial -- beware of untested code!
* Fix by Sjoerd: don't want to resize to zero length.Guido van Rossum1997-09-221-2/+7
|
* fixed ratecv to continue working if product of rates is bigger than 32 bitsGuido van Rossum1997-05-201-0/+21
| | | | (Sjoerd)
* Tweaks to keep the Microsoft compiler quier.Guido van Rossum1997-04-091-7/+7
|