From: Mashiat Sarker Shakkhar Date: Thu, 1 Dec 2011 21:11:21 +0000 (+0600) Subject: Use correct value for range X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=29c2fcb6776f80a0a5551bb82b43bc14c8202331;p=ffmpeg Use correct value for range The current range value causes an underflow when negated and pushes anything less than zero to the minimum. --- diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c index 3b3ff0f7493..5a7957db616 100644 --- a/libavcodec/wmalosslessdec.c +++ b/libavcodec/wmalosslessdec.c @@ -895,7 +895,7 @@ static void lms_update(WmallDecodeCtx *s, int ich, int ilms, int16_t input, int1 { int16_t icoef; int recent = s->cdlms[ich][ilms].recent; - int16_t range = 1 << (s->bits_per_sample - 1); + int16_t range = (1 << s->bits_per_sample - 1) - 1; int bps = s->bits_per_sample > 16 ? 4 : 2; // bytes per sample if (input > pred) {