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

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sat Apr 10 01:13:11 EEST 2021


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
Will apply this soon and backport.

 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);
-- 
2.27.0



More information about the ffmpeg-devel mailing list