aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-31 04:20:24 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-02-23 00:04:11 +0000
commiteb1aa871d4ef9fc11484de436fa02c352b1b7cac (patch)
tree72de7930c7ccb729aa1aef4d42003c46c1141cef
parent6222ee068eeb3d29a2bcc4a89ce31effdef5a061 (diff)
downloadffmpeg-eb1aa871d4ef9fc11484de436fa02c352b1b7cac.tar.gz
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: libav-stable@libav.org Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r--libavcodec/h264_cabac.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c
index 92c1c03740..a8063bd1e1 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -1713,7 +1713,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++; \
} \
\