[libav-commits] als: prevent infinite loop in zero_remaining().

Ronald S. Bultje git at libav.org
Sun Apr 1 19:04:57 CEST 2012


Module: libav
Branch: release/0.7
Commit: 4509129e9d04c93a3de4005787a058d1b950eb03

Author:    Ronald S. Bultje <rsbultje at gmail.com>
Committer: Reinhard Tartler <siretart at tauware.de>
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 at libav.org
(cherry picked from commit af468015d972c0dec5c8c37b2685ffa5cbe4ae87)

Signed-off-by: Anton Khirnov <anton at khirnov.net>
Signed-off-by: Reinhard Tartler <siretart at tauware.de>

---

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

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 17c5490..f2944c6 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1010,7 +1010,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)



More information about the libav-commits mailing list