From 8be56e464bdeeeb8fc0a3a6d8f709c0890c585dd Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 19 Sep 2013 14:20:21 +0200 Subject: [PATCH] avformat/smacker: Check if bufs has been allocated before use Fixes null pointer dereference Signed-off-by: Michael Niedermayer --- libavformat/smacker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/smacker.c b/libavformat/smacker.c index b9bb07e884..0f52dc19e4 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -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);