OSDN Git Service

lavf/id3v2: do not export empty fields.
authorClément Bœsch <ubitux@gmail.com>
Sat, 12 May 2012 20:31:11 +0000 (22:31 +0200)
committerAnton Khirnov <anton@khirnov.net>
Mon, 17 Sep 2012 13:48:20 +0000 (15:48 +0200)
This also avoids a memleak.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavformat/id3v2.c

index e12e930..da02780 100644 (file)
@@ -293,6 +293,8 @@ static void read_ttag(AVFormatContext *s, AVIOContext *pb, int taglen, const cha
     }
     else if (*dst)
         dict_flags |= AV_DICT_DONT_STRDUP_VAL;
+    else
+        av_freep(&dst);
 
     if (dst)
         av_dict_set(&s->metadata, key, dst, dict_flags);