diff options
author | Steven Liu <lq@chinaffmpeg.org> | 2019-10-10 10:47:22 +0800 |
---|---|---|
committer | Steven Liu <lq@chinaffmpeg.org> | 2019-10-19 06:54:12 +0200 |
commit | f5263172de31a03b3d25b962c36047c904e73670 (patch) | |
tree | 369d26b3ce2d88dc9db57dccda46ba363392fc04 /libavformat/mpeg.c | |
parent | 1f7b527194a2a10c334b0ff66ec0a72f4fe65e08 (diff) | |
download | ffmpeg-f5263172de31a03b3d25b962c36047c904e73670.tar.gz |
avformat/mpeg: check av_strdup() return value
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavformat/mpeg.c')
-rw-r--r-- | libavformat/mpeg.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index bd182e4429..df37692f12 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -898,6 +898,11 @@ static int vobsub_read_header(AVFormatContext *s) for (i = 0; i < s->nb_streams; i++) { AVStream *sub_st = s->streams[i]; sub_st->codecpar->extradata = av_strdup(header_str); + if (!sub_st->codecpar->extradata) { + ret = AVERROR(ENOMEM); + sub_st->codecpar->extradata_size = 0; + goto end; + } sub_st->codecpar->extradata_size = header.len; } av_free(header_str); |