[FFmpeg-cvslog] avformat/id3v2: fix memleak with empty strings

Michael Niedermayer git at videolan.org
Thu Aug 11 15:25:26 EEST 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Aug 11 14:10:19 2016 +0200| [cc6a59d2b9116a4084275bbb8634862ddd14ec56] | committer: Michael Niedermayer

avformat/id3v2: fix memleak with empty strings

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cc6a59d2b9116a4084275bbb8634862ddd14ec56
---

 libavformat/id3v2.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index 921a7c2..9969d7a 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;
     }



More information about the ffmpeg-cvslog mailing list