avformat/id3v2: fix memleak with empty strings

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2016-08-11 14:10:19 +02:00
parent b83d907780
commit cc6a59d2b9

View File

@ -422,7 +422,10 @@ static void read_comment(AVFormatContext *s, AVIOContext *pb, int taglen,
return; return;
} }
if (dst && dst[0]) { if (dst && !*dst)
av_freep(&dst);
if (dst) {
key = (const char *) dst; key = (const char *) dst;
dict_flags |= AV_DICT_DONT_STRDUP_KEY; dict_flags |= AV_DICT_DONT_STRDUP_KEY;
} }