Module: libav
Branch: release/0.8
Commit: d6deed7916f7f52dbfc88e2fc2c43e3cfb8ee74b

Author:    Michael Niedermayer <[email protected]>
Committer: Vittorio Giovara <[email protected]>
Date:      Thu Jan 31 04:20:24 2013 +0100

h264_cabac: Break infinite loops

This fixes out of array reads and/or infinite loops.

30 is the maximum number of bits that can be read into
coeff_abs below.

CC: [email protected]
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Martin Storsjö <[email protected]>

---

 libavcodec/h264_cabac.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c
index 2ee4bc0..7f86de5 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -1719,7 +1719,7 @@ decode_cabac_residual_internal(H264Context *h, DCTELEM 
*block,
 \
             if( coeff_abs >= 15 ) { \
                 int j = 0; \
-                while( get_cabac_bypass( CC ) ) { \
+                while (get_cabac_bypass(CC) && j < 30) { \
                     j++; \
                 } \
 \

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to