[FFmpeg-devel] [PATCH 14/21] avformat/microdvddec: Fix memleaks when adding subtitle fails

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Sun Mar 22 05:47:49 EET 2020


The subtitle queue could leak because microdvd_read_close() would never
be called to clean up the subtitle queue if inserting another subtitle
fails. This has been fixed by setting the FF_INPUTFORMAT_HEADER_CLEANUP
flag.

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

diff --git a/libavformat/microdvddec.c b/libavformat/microdvddec.c
index 08e6fca09c..668e317e4b 100644
--- a/libavformat/microdvddec.c
+++ b/libavformat/microdvddec.c
@@ -204,4 +204,5 @@ AVInputFormat ff_microdvd_demuxer = {
     .read_seek2     = microdvd_read_seek,
     .read_close     = microdvd_read_close,
     .priv_class     = &microdvd_class,
+    .flags_internal = FF_INPUTFORMAT_HEADER_CLEANUP,
 };
-- 
2.20.1



More information about the ffmpeg-devel mailing list