aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2010-05-29 14:25:18 +0000
committerReinhard Tartler <siretart@tauware.de>2010-05-29 14:25:18 +0000
commit4e62a6738972275ab4cda625304f1cd25d8a0772 (patch)
tree00c01cd8ffcc16abd953414e00e1b0f54a44a7ec /libavcodec
parent46ac6315fdda4580dbefde96870d848c5bbca608 (diff)
downloadffmpeg-4e62a6738972275ab4cda625304f1cd25d8a0772.tar.gz
Check for VUI overeading and reset num_reoder_frames.
This helps the video from issue1831 backport r23328 by michael Originally committed as revision 23378 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264_ps.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index e5ae403204..7648e2c7a6 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -205,6 +205,12 @@ static inline int decode_vui_parameters(H264Context *h, SPS *sps){
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;