[libav-commits] lavf/id3v2: do not export empty fields.

Clément Bœsch git at libav.org
Mon Sep 17 15:52:59 CEST 2012


Module: libav
Branch: master
Commit: ffdd2e9144f45082ce31f93c20136ade6ed51a54

Author:    Clément Bœsch <ubitux at gmail.com>
Committer: Anton Khirnov <anton at khirnov.net>
Date:      Sat May 12 22:31:11 2012 +0200

lavf/id3v2: do not export empty fields.

This also avoids a memleak.

Signed-off-by: Anton Khirnov <anton at khirnov.net>

---

 libavformat/id3v2.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index e12e930..da02780 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -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);



More information about the libav-commits mailing list