Index: vc1_parser.c
===================================================================
--- vc1_parser.c	(revision 26400)
+++ vc1_parser.c	(working copy)
@@ -51,9 +51,9 @@
 
         next = find_next_marker(start + 4, end);
         size = next - start - 4;
+		if(size <= 0) continue;
         buf2_size = vc1_unescape_buffer(start + 4, size, buf2);
         init_get_bits(&gb, buf2, buf2_size * 8);
-        if(size <= 0) continue;
         switch(AV_RB32(start)){
         case VC1_CODE_SEQHDR:
             vc1_decode_sequence_header(avctx, &vpc->v, &gb);
@@ -144,6 +144,17 @@
 
     vc1_extract_headers(s, avctx, buf, buf_size);
 
+	//	copy header to extra data
+	if(	!(avctx->extradata) ||
+		(avctx->extradata_size < 128)
+		)
+	{
+		av_free(avctx->extradata);
+		avctx->extradata = av_malloc(128);
+		avctx->extradata_size = 128;
+	}
+	memcpy(avctx->extradata, buf, FFMIN(buf_size, 128));
+
     *poutbuf = buf;
     *poutbuf_size = buf_size;
     return next;
