[FFmpeg-cvslog] avformat/matroskaenc: Fix memleak upon encountering bogus chapter

Andreas Rheinhardt git at videolan.org
Fri Jul 3 03:11:15 EEST 2020


ffmpeg | branch: release/3.4 | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Mon Apr 27 05:42:09 2020 +0200| [b7d11cc6e850225eab4c501211edbab57b9acef8] | committer: Andreas Rheinhardt

avformat/matroskaenc: Fix memleak upon encountering bogus chapter

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
(cherry picked from commit cb255b616cf1ebc6bc89b3538b6b7465dc2c526b)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

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

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

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index a52b38731f..697a946ce9 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1497,6 +1497,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;
         }
 



More information about the ffmpeg-cvslog mailing list