提交 c13a7527 编写于 作者: A Andreas Rheinhardt

avformat/jacosubdec: 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: NAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
上级 5ab39c2d
......@@ -188,8 +188,10 @@ static int jacosub_read_header(AVFormatContext *s)
AVPacket *sub;
sub = ff_subtitles_queue_insert(&jacosub->q, line, len, merge_line);
if (!sub)
return AVERROR(ENOMEM);
if (!sub) {
ret = AVERROR(ENOMEM);
goto fail;
}
sub->pos = pos;
merge_line = len > 1 && !strcmp(&line[len - 2], "\\\n");
continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册