From cc6a59d2b9116a4084275bbb8634862ddd14ec56 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 11 Aug 2016 14:10:19 +0200 Subject: avformat/id3v2: fix memleak with empty strings Signed-off-by: Michael Niedermayer --- libavformat/id3v2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libavformat/id3v2.c') diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index 921a7c2399..9969d7a6ca 100644 --- a/libavformat/id3v2.c +++ b/libavformat/id3v2.c @@ -422,7 +422,10 @@ static void read_comment(AVFormatContext *s, AVIOContext *pb, int taglen, return; } - if (dst && dst[0]) { + if (dst && !*dst) + av_freep(&dst); + + if (dst) { key = (const char *) dst; dict_flags |= AV_DICT_DONT_STRDUP_KEY; } -- cgit v1.2.3