asfdec: do not export empty metadata
authorAlexandra Hájková <alexandra.khirnova@gmail.com>
Mon, 27 Jul 2015 17:42:15 +0000 (19:42 +0200)
committerAnton Khirnov <anton@khirnov.net>
Fri, 31 Jul 2015 07:09:27 +0000 (09:09 +0200)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavformat/asfdec.c

index 72c59168a891d07856976d3a5d5ed1815040c6f2..790102b3787bfaf26351a48da07fc550ee472030 100644 (file)
@@ -256,8 +256,10 @@ static int asf_read_metadata(AVFormatContext *s, const char *title, uint16_t len
     AVIOContext *pb = s->pb;
 
     avio_get_str16le(pb, len, ch, buflen);
-    if (av_dict_set(&s->metadata, title, ch, 0) < 0)
-        av_log(s, AV_LOG_WARNING, "av_dict_set failed.\n");
+    if (ch[0]) {
+        if (av_dict_set(&s->metadata, title, ch, 0) < 0)
+            av_log(s, AV_LOG_WARNING, "av_dict_set failed.\n");
+    }
 
     return 0;
 }