Skip to content

Commit 450f5ae

Browse files
committed
avformat/matroskaenc: Fix leak when writing attachment without filename
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> (cherry picked from commit 08c805f)
1 parent f68ab9d commit 450f5ae

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libavformat/matroskaenc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,6 +1768,7 @@ static int mkv_write_attachments(AVFormatContext *s)
17681768
put_ebml_string(dyn_cp, MATROSKA_ID_FILEDESC, t->value);
17691769
if (!(t = av_dict_get(st->metadata, "filename", NULL, 0))) {
17701770
av_log(s, AV_LOG_ERROR, "Attachment stream %d has no filename tag.\n", i);
1771+
ffio_free_dyn_buf(&dyn_cp);
17711772
return AVERROR(EINVAL);
17721773
}
17731774
put_ebml_string(dyn_cp, MATROSKA_ID_FILENAME, t->value);

0 commit comments

Comments
 (0)