mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
avformat/smacker: Check if bufs has been allocated before use
Fixes null pointer dereference Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
93648ee47b
commit
8be56e464b
@ -351,7 +351,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
smk->cur_frame++;
|
smk->cur_frame++;
|
||||||
smk->nextpos = avio_tell(s->pb);
|
smk->nextpos = avio_tell(s->pb);
|
||||||
} else {
|
} else {
|
||||||
if (smk->stream_id[smk->curstream] < 0)
|
if (smk->stream_id[smk->curstream] < 0 || !smk->bufs[smk->curstream])
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
if (av_new_packet(pkt, smk->buf_sizes[smk->curstream]))
|
if (av_new_packet(pkt, smk->buf_sizes[smk->curstream]))
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user