skip b frames before first i frame
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 29 Feb 2004 02:25:19 +0000 (02:25 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 29 Feb 2004 02:25:19 +0000 (02:25 +0000)
Originally committed as revision 2829 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/rv10.c

index adcc87c..11c9734 100644 (file)
@@ -360,6 +360,11 @@ static int rv20_decode_picture_header(MpegEncContext *s)
         return -1;
     }
     
         return -1;
     }
     
+    if(s->last_picture_ptr==NULL && s->pict_type==B_TYPE){
+        av_log(s->avctx, AV_LOG_ERROR, "early B pix\n");
+        return -1;
+    }
+    
     if (get_bits(&s->gb, 1)){
         av_log(s->avctx, AV_LOG_ERROR, "unknown bit set\n");
         return -1;
     if (get_bits(&s->gb, 1)){
         av_log(s->avctx, AV_LOG_ERROR, "unknown bit set\n");
         return -1;