diff mbox series

[FFmpeg-devel,18/21] avformat/assdec: Fix memleak when reading header fails

Message ID 20200322034756.29907-18-andreas.rheinhardt@gmail.com
State Superseded
Headers show
Series [FFmpeg-devel,01/21] avformat/nsvdec: Use av_packet_move_ref() for packet ownership transfer | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Andreas Rheinhardt March 22, 2020, 3:47 a.m. UTC
In this case, the subtitle queue would leak because ass_read_close() is
not called automatically when reading the header fails. This is changed
by setting the FF_INPUTFORMAT_HEADER_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/assdec.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/libavformat/assdec.c b/libavformat/assdec.c
index f66b296673..d9e0af264a 100644
--- a/libavformat/assdec.c
+++ b/libavformat/assdec.c
@@ -189,4 +189,5 @@  AVInputFormat ff_ass_demuxer = {
     .read_packet    = ass_read_packet,
     .read_close     = ass_read_close,
     .read_seek2     = ass_read_seek,
+    .flags_internal = FF_INPUTFORMAT_HEADER_CLEANUP,
 };