• Tim Peters's avatar
    SF bug 482574: audioop.ratecv crashes. · 1691bd9f
    Tim Peters yazdı
    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.
    1691bd9f
audioop.c 37 KB