mirror of https://git.ffmpeg.org/ffmpeg.git
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>
This commit is contained in:
parent
c13a752733
commit
d38694cea9
|
@ -202,6 +202,7 @@ static int lrc_read_header(AVFormatContext *s)
|
||||||
sub = ff_subtitles_queue_insert(&lrc->q, line.str + ts_strlength,
|
sub = ff_subtitles_queue_insert(&lrc->q, line.str + ts_strlength,
|
||||||
line.len - ts_strlength, 0);
|
line.len - ts_strlength, 0);
|
||||||
if(!sub) {
|
if(!sub) {
|
||||||
|
ff_subtitles_queue_clean(&lrc->q);
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
sub->pos = pos;
|
sub->pos = pos;
|
||||||
|
|
Loading…
Reference in New Issue