Library
-------
+- Issue #1621: Avoid signed int negation overflow in the "audioop" module.
+
- Issue #27533: Release GIL in nt._isdir
- Issue #17711: Fixed unpickling by the persistent ID with protocol 0.
return NULL;
for (i = 0; i < fragment->len; i += width) {
int val = GETRAWSAMPLE(width, fragment->buf, i);
- if (val < 0) absval = (-val);
+ /* Cast to unsigned before negating. Unsigned overflow is well-
+ defined, but signed overflow is not. */
+ if (val < 0) absval = -(unsigned int)val;
else absval = val;
if (absval > max) max = absval;
}