mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-27 17:21:05 +00:00
avformat/mpsubdec: Fix memleak upon read header failure
The already parsed subtitles (contained in an FFDemuxSubtitlesQueue) would leak if an error happened upon creating an AVStream. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
331799747e
commit
a5ed8aeea4
@ -154,8 +154,10 @@ static int mpsub_read_header(AVFormatContext *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
st = avformat_new_stream(s, NULL);
|
st = avformat_new_stream(s, NULL);
|
||||||
if (!st)
|
if (!st) {
|
||||||
return AVERROR(ENOMEM);
|
res = AVERROR(ENOMEM);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
avpriv_set_pts_info(st, 64, pts_info.den, pts_info.num);
|
avpriv_set_pts_info(st, 64, pts_info.den, pts_info.num);
|
||||||
st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
|
st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
|
||||||
st->codecpar->codec_id = AV_CODEC_ID_TEXT;
|
st->codecpar->codec_id = AV_CODEC_ID_TEXT;
|
||||||
|
Loading…
Reference in New Issue
Block a user