diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-29 16:54:28 -0700 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2012-05-02 10:26:05 -0700 |
commit | 1f05dcbad243622020151a3b0b45c68ea5f2866c (patch) | |
tree | 724f207c59944aea0c239ef94991d713a295bc26 /libavcodec | |
parent | 2d22d4307dcc1461f39a2ffb9c8db6c6b23fd080 (diff) | |
download | ffmpeg-1f05dcbad243622020151a3b0b45c68ea5f2866c.tar.gz |
ituh263dec: Implement enough of Annex O (scalability) to fix a FPE.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/ituh263dec.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index f52ac7abfc..73e8bf56ef 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -1083,6 +1083,22 @@ int ff_h263_decode_picture_header(MpegEncContext *s) skip_bits(&s->gb, 2); /* Quantization information for B-pictures */ } + if (s->pict_type!=AV_PICTURE_TYPE_B) { + s->time = s->picture_number; + s->pp_time = s->time - s->last_non_b_time; + s->last_non_b_time = s->time; + }else{ + s->time = s->picture_number; + s->pb_time = s->pp_time - (s->last_non_b_time - s->time); + if (s->pp_time <=s->pb_time || + s->pp_time <= s->pp_time - s->pb_time || + s->pp_time <= 0){ + s->pp_time = 2; + s->pb_time = 1; + } + ff_mpeg4_init_direct_mv(s); + } + /* PEI */ while (get_bits1(&s->gb) != 0) { skip_bits(&s->gb, 8); |