vp5: don't try decoding a P frame before any I frame was parsed
authorAurelien Jacobs <aurel@gnuage.org>
Tue, 27 Jan 2009 00:23:27 +0000 (00:23 +0000)
committerAurelien Jacobs <aurel@gnuage.org>
Tue, 27 Jan 2009 00:23:27 +0000 (00:23 +0000)
fix issue802

Originally committed as revision 16813 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/vp5.c

index e47db0d..3eecb56 100644 (file)
@@ -64,7 +64,8 @@ static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,
             avcodec_set_dimensions(s->avctx, 16*cols, 16*rows);
             return 2;
         }
-    }
+    } else if (!s->macroblocks)
+        return 0;
     return 1;
 }