diff mbox series

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

Message ID HE1PR0301MB21544F9427A3D036B4B61E128F739@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit 08c805f4ac767444ccc04a37ca6b99d719a6b58f
Headers show
Series [FFmpeg-devel] avformat/matroskaenc: Fix leak when writing attachment without filename
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt April 9, 2021, 10:13 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
Will apply this soon and backport.

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

Patch

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