Commit bf29cf8e authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

avformat/sccdec: 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 f3c63e67bb00fa7d96595203d01a576df651e275)
parent 6e64260a
......@@ -136,7 +136,7 @@ try_again:
sub = ff_subtitles_queue_insert(&scc->q, out, i, 0);
if (!sub)
return AVERROR(ENOMEM);
goto fail;
sub->pos = current_pos;
sub->pts = ts_start;
......@@ -155,6 +155,9 @@ try_again:
ff_subtitles_queue_finalize(s, &scc->q);
return ret;
fail:
ff_subtitles_queue_clean(&scc->q);
return AVERROR(ENOMEM);
}
static int scc_read_packet(AVFormatContext *s, AVPacket *pkt)
......
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