aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-09-28 16:14:08 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-09-28 17:11:52 +0200
commit8c43f320574d201fe1b696b133c08368f5f18508 (patch)
tree7880653dc3ea2b5dca990d894b72e7f627750ffd
parent77d5a237ef6803e3b5a138fdee10bf1f62e4a7d7 (diff)
downloadffmpeg-8c43f320574d201fe1b696b133c08368f5f18508.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>
-rw-r--r--libavformat/avidec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 2e053a3c8a..7adb819346 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1094,6 +1094,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);
*st->codec = *ast->sub_ctx->streams[0]->codec;
ast->sub_ctx->streams[0]->codec->extradata = NULL;