[FFmpeg-cvslog] avformat/lrcdec: Fix memleak upon read header failure

Andreas Rheinhardt git at videolan.org
Fri Jul 3 16:09:11 EEST 2020


ffmpeg | branch: release/3.3 | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sun Jun 14 03:12:00 2020 +0200| [e95ebaa3323e3244dc391908db96a09e6f2f9469] | committer: Andreas Rheinhardt

avformat/lrcdec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

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

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

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

diff --git a/libavformat/lrcdec.c b/libavformat/lrcdec.c
index f4e9a4efa9..45f0bf24a7 100644
--- a/libavformat/lrcdec.c
+++ b/libavformat/lrcdec.c
@@ -202,6 +202,7 @@ static int lrc_read_header(AVFormatContext *s)
                 sub = ff_subtitles_queue_insert(&lrc->q, line.str + ts_strlength,
                                                 line.len - ts_strlength, 0);
                 if(!sub) {
+                    ff_subtitles_queue_clean(&lrc->q);
                     return AVERROR(ENOMEM);
                 }
                 sub->pos = pos;



More information about the ffmpeg-cvslog mailing list