diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-01-26 19:31:01 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-26 19:54:38 +0100 |
commit | 9decfc17bb76da34734296048d390b176abf404c (patch) | |
tree | 2dbb68356810531f0584b311b085b02f35b96bd7 | |
parent | fe0089a6edb974f000b7f8dced4d6c6c3c5f2985 (diff) | |
download | ffmpeg-9decfc17bb76da34734296048d390b176abf404c.tar.gz |
h264_sei: Fix infinite loop.
Fixes not yet fixed parts of CVE-2011-3946.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/h264_sei.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c index 374e53dfcf..80d70e513c 100644 --- a/libavcodec/h264_sei.c +++ b/libavcodec/h264_sei.c @@ -169,11 +169,15 @@ int ff_h264_decode_sei(H264Context *h){ type=0; do{ + if (get_bits_left(&s->gb) < 8) + return -1; type+= show_bits(&s->gb, 8); }while(get_bits(&s->gb, 8) == 255); size=0; do{ + if (get_bits_left(&s->gb) < 8) + return -1; size+= show_bits(&s->gb, 8); }while(get_bits(&s->gb, 8) == 255); |