]> git.sesse.net Git - ffmpeg/commitdiff
Use correct value for range
authorMashiat Sarker Shakkhar <shahriman_ams@yahoo.com>
Thu, 1 Dec 2011 21:11:21 +0000 (03:11 +0600)
committerMashiat Sarker Shakkhar <shahriman_ams@yahoo.com>
Thu, 1 Dec 2011 21:11:21 +0000 (03:11 +0600)
The current range value causes an underflow
when negated and pushes anything less than zero
to the minimum.

libavcodec/wmalosslessdec.c

index 3b3ff0f7493f9309999e96c8403c86a3e2c0ee8f..5a7957db61677e2412abdefa35d28c7fe614de38 100644 (file)
@@ -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) {