changeset 5659:d76ffa7128d4 libavformat

Strings in extended content header are UTF16, so terminating NULLs are 2 bytes long, not 1. Patch by Anton Khirnov, wyskas gmail
author cehoyos
date Mon, 15 Feb 2010 21:19:40 +0000
parents 9e6fd33adfb4
children 1701ad9b6064
files asfenc.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/asfenc.c	Mon Feb 15 21:14:47 2010 +0000
+++ b/asfenc.c	Mon Feb 15 21:19:40 2010 +0000
@@ -352,13 +352,13 @@
         hpos = put_header(pb, &ff_asf_extended_content_header);
         put_le16(pb, metadata_count);
         while ((tag = av_metadata_get(s->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) {
-            put_le16(pb, 2*(strlen(tag->key) + 3) + 1);
+            put_le16(pb, 2*(strlen(tag->key) + 4));
             put_le16(pb, 'W');
             put_le16(pb, 'M');
             put_le16(pb, '/');
             put_str16_nolen(pb, tag->key);
             put_le16(pb, 0);
-            put_le16(pb, 2*strlen(tag->value) + 1);
+            put_le16(pb, 2*(strlen(tag->value) + 1));
             put_str16_nolen(pb, tag->value);
         }
         end_header(pb, hpos);