aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-06-14 03:12:00 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-06-15 16:54:05 +0200
commitd38694cea9f289b3f9dcce1a2f07746d029b35f3 (patch)
tree26b84f5915a4580abaf1470bb82b213c4630945c
parentc13a752733a9af955b032c55f704b748fe37dd19 (diff)
downloadffmpeg-d38694cea9f289b3f9dcce1a2f07746d029b35f3.tar.gz
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@gmail.com>
-rw-r--r--libavformat/lrcdec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/lrcdec.c b/libavformat/lrcdec.c
index a9a117691a..46d5e2bc6a 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;