[FFmpeg-cvslog] r23378 - in branches/0.6: . libavcodec/h264_ps.c

siretart subversion
Sat May 29 16:25:19 CEST 2010


Author: siretart
Date: Sat May 29 16:25:18 2010
New Revision: 23378

Log:
Check for VUI overeading and reset num_reoder_frames.
This helps the video from issue1831


backport r23328 by michael

Modified:
   branches/0.6/   (props changed)
   branches/0.6/libavcodec/h264_ps.c

Modified: branches/0.6/libavcodec/h264_ps.c
==============================================================================
--- branches/0.6/libavcodec/h264_ps.c	Sat May 29 16:20:05 2010	(r23377)
+++ branches/0.6/libavcodec/h264_ps.c	Sat May 29 16:25:18 2010	(r23378)
@@ -205,6 +205,12 @@ static inline int decode_vui_parameters(
         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;



More information about the ffmpeg-cvslog mailing list