[FFmpeg-cvslog] r21840 - trunk/libavformat/asfdec.c

cehoyos subversion
Mon Feb 15 22:14:47 CET 2010


Author: cehoyos
Date: Mon Feb 15 22:14:47 2010
New Revision: 21840

Log:
workaround for broken files created by previous versions of asfenc.

Patch by Anton Khirnov, wyskas gmail

Modified:
   trunk/libavformat/asfdec.c

Modified: trunk/libavformat/asfdec.c
==============================================================================
--- trunk/libavformat/asfdec.c	Mon Feb 15 20:22:09 2010	(r21839)
+++ trunk/libavformat/asfdec.c	Mon Feb 15 22:14:47 2010	(r21840)
@@ -436,9 +436,13 @@ static int asf_read_header(AVFormatConte
                     char name[1024];
 
                     name_len = get_le16(pb);
+                    if (name_len%2)     // must be even, broken lavf versions wrote len-1
+                        name_len += 1;
                     get_str16_nolen(pb, name_len, name, sizeof(name));
                     value_type = get_le16(pb);
                     value_len  = get_le16(pb);
+                    if (value_len%2)
+                        value_len += 1;
                     get_tag(s, name, value_type, value_len);
             }
         } else if (!guidcmp(&g, &ff_asf_metadata_header)) {



More information about the ffmpeg-cvslog mailing list