diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-06-14 03:21:46 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-06-15 16:54:05 +0200 |
commit | f161f8e4ad10c8ae5b2e97870e09bc6a421408eb (patch) | |
tree | 9e10ddbbcadcc5d97811f253914cfbd5f1ba601a /libavformat/samidec.c | |
parent | 9df560e8986640e20c62286f0baee2a80540accd (diff) | |
download | ffmpeg-f161f8e4ad10c8ae5b2e97870e09bc6a421408eb.tar.gz |
avformat/samidec: 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
or when creating extradata.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat/samidec.c')
-rw-r--r-- | libavformat/samidec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/samidec.c b/libavformat/samidec.c index fd98393086..3070ef9bac 100644 --- a/libavformat/samidec.c +++ b/libavformat/samidec.c @@ -108,6 +108,8 @@ static int sami_read_header(AVFormatContext *s) ff_subtitles_queue_finalize(s, &sami->q); end: + if (res < 0) + ff_subtitles_queue_clean(&sami->q); av_bprint_finalize(&buf, NULL); return res; } |