[FFmpeg-cvslog] lavf/id3v2: do not export empty fields.

Clément Bœsch git at videolan.org
Sat May 19 12:32:31 CEST 2012


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Sat May 12 22:31:11 2012 +0200| [6ad974ae1cd0c828d6dd5a665e830c10c93344b6] | committer: Clément Bœsch

lavf/id3v2: do not export empty fields.

This also avoids a memleak.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6ad974ae1cd0c828d6dd5a665e830c10c93344b6
---

 libavformat/id3v2.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index 1352b57..97a23c4 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -303,6 +303,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);



More information about the ffmpeg-cvslog mailing list