diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-09-28 16:14:08 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-10-01 02:50:54 +0200 |
commit | 622ccbd8ab894e3ac6cdf607e3d4f39e406786e9 (patch) | |
tree | e4b9d55495f9f153d487f74f0bc274f4e98c4f8f /libavformat | |
parent | c8c5f66b42edc37474baa5cb51460cbf6f33075b (diff) | |
download | ffmpeg-622ccbd8ab894e3ac6cdf607e3d4f39e406786e9.tar.gz |
avformat/avidec: Check nb_streams in read_gab2_sub()
Fixes null pointer dereference
Fixes: 1/null_point.avi
Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2679ad4773aa356e7c3da5c68bc81f02a194617f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/avidec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 410c2d59df..3c5f3ec10c 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -1097,6 +1097,8 @@ static int read_gab2_sub(AVFormatContext *s, AVStream *st, AVPacket *pkt) goto error; if (!avformat_open_input(&ast->sub_ctx, "", sub_demuxer, NULL)) { + if (ast->sub_ctx->nb_streams != 1) + goto error; ff_read_packet(ast->sub_ctx, &ast->sub_pkt); avcodec_parameters_copy(st->codecpar, ast->sub_ctx->streams[0]->codecpar); time_base = ast->sub_ctx->streams[0]->time_base; |