[FFmpeg-cvslog] avformat/matroskaenc: Fix leak when writing attachment without filename

Andreas Rheinhardt git at videolan.org
Sat Apr 10 06:11:56 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sat Apr 10 00:11:06 2021 +0200| [08c805f4ac767444ccc04a37ca6b99d719a6b58f] | committer: Andreas Rheinhardt

avformat/matroskaenc: Fix leak when writing attachment without filename

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 libavformat/matroskaenc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 609a588f78..7e108f2db9 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1768,6 +1768,7 @@ static int mkv_write_attachments(AVFormatContext *s)
             put_ebml_string(dyn_cp, MATROSKA_ID_FILEDESC, t->value);
         if (!(t = av_dict_get(st->metadata, "filename", NULL, 0))) {
             av_log(s, AV_LOG_ERROR, "Attachment stream %d has no filename tag.\n", i);
+            ffio_free_dyn_buf(&dyn_cp);
             return AVERROR(EINVAL);
         }
         put_ebml_string(dyn_cp, MATROSKA_ID_FILENAME, t->value);



More information about the ffmpeg-cvslog mailing list