Commit 194bdf50 authored by Volker Rümelin's avatar Volker Rümelin Committed by Gerd Hoffmann
Browse files

audio: fix saturation nonlinearity in clip_* functions



The current positive limit for the saturation nonlinearity is
only correct if the type of the result has 8 bits or less.

Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
Message-id: 20200308193321.20668-5-vr_qemu@t-online.de
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 4218fdd7
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -83,10 +83,9 @@ static inline int64_t glue (conv_, ET) (IN_T v)

static inline IN_T glue (clip_, ET) (int64_t v)
{
    if (v >= 0x7f000000) {
    if (v >= 0x7fffffffLL) {
        return IN_MAX;
    }
    else if (v < -2147483648LL) {
    } else if (v < -2147483648LL) {
        return IN_MIN;
    }