Commit b7897f03 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

avformat/vplayerdec: 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: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit 67434afa7fcb2b411b10a4d09fb30cd3a5907c2c)
parent 6eac7d79
...@@ -83,8 +83,10 @@ static int vplayer_read_header(AVFormatContext *s) ...@@ -83,8 +83,10 @@ static int vplayer_read_header(AVFormatContext *s)
AVPacket *sub; AVPacket *sub;
sub = ff_subtitles_queue_insert(&vplayer->q, p, strlen(p), 0); sub = ff_subtitles_queue_insert(&vplayer->q, p, strlen(p), 0);
if (!sub) if (!sub) {
ff_subtitles_queue_clean(&vplayer->q);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
}
sub->pos = pos; sub->pos = pos;
sub->pts = pts_start; sub->pts = pts_start;
sub->duration = -1; sub->duration = -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment