diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index cccfdb41b6..36b29e2d8d 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; }