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: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit c13a752733)
This commit is contained in:
parent
788a7c027b
commit
db2002aee7
1 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue