avformat/oggparsevorbis: fix leak of ct
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 7 Aug 2013 15:18:19 +0000 (17:18 +0200)
committerJames Almer <jamrial@gmail.com>
Wed, 18 Sep 2013 17:52:58 +0000 (14:52 -0300)
Fixes CID1061058
Fixes fate

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d0a882ab1d2a4197da1edd77450af30e2da3460e)

libavformat/oggparsevorbis.c

index a21b3a9..3938f07 100644 (file)
@@ -136,11 +136,13 @@ ff_vorbis_comment(AVFormatContext * as, AVDictionary **m, const uint8_t *buf, in
 
                 if (!pict) {
                     av_log(as, AV_LOG_WARNING, "out-of-memory error. Skipping cover art block.\n");
+                    av_freep(&ct);
                     continue;
                 }
                 if ((ret = av_base64_decode(pict, ct, vl)) > 0)
                     ret = ff_flac_parse_picture(as, pict, ret);
                 av_freep(&pict);
+                av_freep(&ct);
                 if (ret < 0) {
                     av_log(as, AV_LOG_WARNING, "Failed to parse cover art block.\n");
                     continue;