[FFmpeg-cvslog] wmalossless: Fix infinite loop.

Michael Niedermayer git at videolan.org
Sun Feb 19 22:12:00 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Feb 19 21:50:18 2012 +0100| [f4f386dd00e594dc90eb32ae872ae8e22b08d179] | committer: Michael Niedermayer

wmalossless: Fix infinite loop.

Fixes more of Ticket1000

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 79cd5f4..b32731f 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -713,8 +713,11 @@ static int decode_channel_residues(WmallDecodeCtx *s, int ch, int tile_size)
     //av_log(0, 0, "%8d: ", num_logged_tiles++);
     for(; i < tile_size; i++) {
         int quo = 0, rem, rem_bits, residue;
-        while(get_bits1(&s->gb))
+        while(get_bits1(&s->gb)) {
             quo++;
+            if (get_bits_left(&s->gb) <= 0)
+                return -1;
+        }
         if(quo >= 32)
             quo += get_bits_long(&s->gb, get_bits(&s->gb, 5) + 1);
 



More information about the ffmpeg-cvslog mailing list