diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-19 14:20:21 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-19 14:20:21 +0200 |
commit | 8be56e464bdeeeb8fc0a3a6d8f709c0890c585dd (patch) | |
tree | 4299d66d66635fffdef694c937e1f5ba0f34b8b3 | |
parent | 93648ee47b8f70159d5f41b8cebf14cbc7485fbe (diff) | |
download | ffmpeg-8be56e464bdeeeb8fc0a3a6d8f709c0890c585dd.tar.gz |
avformat/smacker: Check if bufs has been allocated before use
Fixes null pointer dereference
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/smacker.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |