Check direct_8x8_inference_flag.
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 7 Feb 2010 15:12:37 +0000 (15:12 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 7 Feb 2010 15:12:37 +0000 (15:12 +0000)
Originally committed as revision 21668 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/h264_ps.c

index 6b9e6e9..0c4083f 100644 (file)
@@ -347,6 +347,10 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
         sps->mb_aff= 0;
 
     sps->direct_8x8_inference_flag= get_bits1(&s->gb);
         sps->mb_aff= 0;
 
     sps->direct_8x8_inference_flag= get_bits1(&s->gb);
+    if(!sps->frame_mbs_only_flag && !sps->direct_8x8_inference_flag){
+        av_log(h->s.avctx, AV_LOG_ERROR, "This stream was generated by a broken encoder, invalid 8x8 inference\n");
+        goto fail;
+    }
 
 #ifndef ALLOW_INTERLACE
     if(sps->mb_aff)
 
 #ifndef ALLOW_INTERLACE
     if(sps->mb_aff)