[FFmpeg-devel] [PATCH 07/13] lavf/id3v2: do not export empty fields.

Clément Bœsch ubitux at gmail.com
Sat May 12 23:15:29 CEST 2012


This also avoids a memleak.
---
 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);
-- 
1.7.10.1



More information about the ffmpeg-devel mailing list