OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
14bac7e
)
avformat/avidec: Check nb_streams in read_gab2_sub()
author
Michael Niedermayer
<michael@niedermayer.cc>
Wed, 28 Sep 2016 14:14:08 +0000
(16:14 +0200)
committer
Michael Niedermayer
<michael@niedermayer.cc>
Wed, 28 Sep 2016 14:46:24 +0000
(16:46 +0200)
Fixes null pointer dereference
Fixes: 1/null_point.avi
Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/avidec.c
patch
|
blob
|
history
diff --git
a/libavformat/avidec.c
b/libavformat/avidec.c
index
96edfa8
..
2c81267
100644
(file)
--- a/
libavformat/avidec.c
+++ b/
libavformat/avidec.c
@@
-1101,6
+1101,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;