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; }