[FFmpeg-devel] [PATCH 6/7] avformat/matroskaenc: Fix memleak upon encountering bogus chapter

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Tue Apr 28 11:36:44 EEST 2020


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavformat/matroskaenc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 668b18e9ee..09f08c1e9f 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1463,6 +1463,7 @@ static int mkv_write_chapters(AVFormatContext *s)
             av_log(s, AV_LOG_ERROR,
                    "Invalid chapter start (%"PRId64") or end (%"PRId64").\n",
                    chapterstart, chapterend);
+            ffio_free_dyn_buf(&dyn_cp);
             return AVERROR_INVALIDDATA;
         }
 
-- 
2.20.1



More information about the ffmpeg-devel mailing list