Mercurial > libavcodec.hg
changeset 11767:572bf2d9931e libavcodec
Check for VUI overeading and reset num_reoder_frames.
This helps the video from issue1831
author | michael |
---|---|
date | Tue, 25 May 2010 21:51:27 +0000 |
parents | 01408f7d629c |
children | b02a8a91e27d |
files | h264_ps.c |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/h264_ps.c Tue May 25 19:16:15 2010 +0000 +++ b/h264_ps.c Tue May 25 21:51:27 2010 +0000 @@ -205,6 +205,12 @@ sps->num_reorder_frames= get_ue_golomb(&s->gb); get_ue_golomb(&s->gb); /*max_dec_frame_buffering*/ + if(s->gb.size_in_bits < get_bits_count(&s->gb)){ + av_log(h->s.avctx, AV_LOG_ERROR, "Overread VUI by %d bits\n", get_bits_count(&s->gb) - s->gb.size_in_bits); + sps->num_reorder_frames=0; + sps->bitstream_restriction_flag= 0; + } + if(sps->num_reorder_frames > 16U /*max_dec_frame_buffering || max_dec_frame_buffering > 16*/){ av_log(h->s.avctx, AV_LOG_ERROR, "illegal num_reorder_frames %d\n", sps->num_reorder_frames); return -1;