Commit 8be56e46 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/smacker: Check if bufs has been allocated before use

Fixes null pointer dereference
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 93648ee4
......@@ -351,7 +351,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
smk->cur_frame++;
smk->nextpos = avio_tell(s->pb);
} else {
if (smk->stream_id[smk->curstream] < 0)
if (smk->stream_id[smk->curstream] < 0 || !smk->bufs[smk->curstream])
return AVERROR_INVALIDDATA;
if (av_new_packet(pkt, smk->buf_sizes[smk->curstream]))
return AVERROR(ENOMEM);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment