[FFmpeg-cvslog] h264/cabac: check loop index

Michael Niedermayer git at videolan.org
Thu Jan 31 04:35:58 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jan 31 04:20:24 2013 +0100| [cdf0877bc341684c56ac1fe057397adbadf329ee] | committer: Michael Niedermayer

h264/cabac: check loop index

fix out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 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 bbca26a..54b3775 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -1712,7 +1712,7 @@ decode_cabac_residual_internal(H264Context *h, int16_t *block,
 \
             if( coeff_abs >= 15 ) { \
                 int j = 0; \
-                while( get_cabac_bypass( CC ) ) { \
+                while(get_cabac_bypass( CC ) && j<30) { \
                     j++; \
                 } \
 \



More information about the ffmpeg-cvslog mailing list