mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-12 10:00:08 +01:00
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 2679ad4773)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -1090,6 +1090,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;
|
||||
|
||||
Reference in New Issue
Block a user