als: prevent infinite loop in zero_remaining().

Message ID 20120217203536.B0B625DAFF@aruru.libav.org
State New
Headers show

Commit Message

Janne Grunau Feb. 17, 2012, 8:35 p.m.
Module: libav
Branch: master
Commit: af468015d972c0dec5c8c37b2685ffa5cbe4ae87

Author:    Ronald S. Bultje <rsbultje@gmail.com>
Committer: Ronald S. Bultje <rsbultje@gmail.com>
Date:      Fri Feb 17 12:28:26 2012 -0800

als: prevent infinite loop in zero_remaining().

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org

---

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

Patch

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index d54ae87..bdc0be1 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1011,7 +1011,7 @@  static void zero_remaining(unsigned int b, unsigned int b_max,
 {
     unsigned int count = 0;
 
-    while (b < b_max)
+    for (; b < b_max; b++)
         count += div_blocks[b];
 
     if (count)