You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-16 22:42:38 +02:00
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
)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
@ -187,8 +187,10 @@ static int jacosub_read_header(AVFormatContext *s)
|
|||||||
AVPacket *sub;
|
AVPacket *sub;
|
||||||
|
|
||||||
sub = ff_subtitles_queue_insert(&jacosub->q, line, len, merge_line);
|
sub = ff_subtitles_queue_insert(&jacosub->q, line, len, merge_line);
|
||||||
if (!sub)
|
if (!sub) {
|
||||||
return AVERROR(ENOMEM);
|
ret = AVERROR(ENOMEM);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
sub->pos = pos;
|
sub->pos = pos;
|
||||||
merge_line = len > 1 && !strcmp(&line[len - 2], "\\\n");
|
merge_line = len > 1 && !strcmp(&line[len - 2], "\\\n");
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user