[FFmpeg-cvslog] Use correct value for range

Mashiat Sarker Shakkhar git at videolan.org
Wed Dec 7 04:57:33 CET 2011


ffmpeg | branch: master | Mashiat Sarker Shakkhar <shahriman_ams at yahoo.com> | Fri Dec  2 03:11:21 2011 +0600| [29c2fcb6776f80a0a5551bb82b43bc14c8202331] | committer: Mashiat Sarker Shakkhar

Use correct value for range

The current range value causes an underflow
when negated and pushes anything less than zero
to the minimum.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=29c2fcb6776f80a0a5551bb82b43bc14c8202331
---

 libavcodec/wmalosslessdec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 3b3ff0f..5a7957d 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) {



More information about the ffmpeg-cvslog mailing list